From 02d4ab1a60eb48f00ad60ec48d02b65509a27e56 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sat, 9 May 2015 18:30:28 +0200 Subject: fix sessions lasting through reinstallations, they are now deleted --- install/index.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'install/index.php') diff --git a/install/index.php b/install/index.php index 77e50864..81fd407a 100755 --- a/install/index.php +++ b/install/index.php @@ -16,6 +16,26 @@ $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 +session_destroy(); + + if (isset($_GET['clean'])) { if (is_dir('install')){ delTree('install', true); -- cgit v1.2.3