]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - install/index.php
just make sure this variable is gone for #1114
[github/wallabag/wallabag.git] / install / index.php
index 77e50864015b4bbb7b0092eebd7ae013ab1f073b..654d21cab8575157e309d6e36d1e06ecea4b76f3 100755 (executable)
@@ -16,6 +16,29 @@ $email = "";
 
 require_once('install_functions.php');
 
+// Start by destroying session to avoid wrong logins from previous installations
+// cookie part
+$cookiedir = '';
+if (dirname($_SERVER['SCRIPT_NAME'])!='/') {
+    $cookiedir = dirname($_SERVER["SCRIPT_NAME"]).'/';
+}
+
+if (isset($_SERVER['HTTP_COOKIE'])) {
+    $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
+    foreach($cookies as $cookie) {
+        $parts = explode('=', $cookie);
+        $name = trim($parts[0]);
+        setcookie($name, '', time()-1000);
+        setcookie($name, '', time()-1000, $cookiedir);
+    }
+}
+// session part
+if (isset($_SESSION['poche_user'])) {
+       unset($_SESSION['poche_user']);
+}
+session_destroy();
+
+
 if (isset($_GET['clean'])) {
     if (is_dir('install')){
         delTree('install', true);