diff --git a/lib/github-manager.php b/lib/github-manager.php
index 6d1781b..18eb694 100644
--- a/lib/github-manager.php
+++ b/lib/github-manager.php
@@ -52,6 +52,10 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
$fh = fopen($settingsFile, 'w');
fwrite($fh, $settingsContents);
fclose($fh);
+
+ // Clear any FTP session we may have
+ $_SESSION['ftpSiteRef'] = false;
+
// Hide this popup and reload file manager
echo "";
} else {
diff --git a/lib/go-localhost-root.php b/lib/go-localhost-root.php
index 26af7a5..82d98aa 100644
--- a/lib/go-localhost-root.php
+++ b/lib/go-localhost-root.php
@@ -22,6 +22,10 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn']) {
$fh = fopen($settingsFile, 'w');
fwrite($fh, $settingsContents);
fclose($fh);
+
+ // Clear any FTP session we may have
+ $_SESSION['ftpSiteRef'] = false;
+
// Now we've reset the root path to localhost root, refresh the file manager to show it
echo "";
} else {