mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-27 16:36:00 +00:00
fix sessions lasting through reinstallations, they are now deleted
This commit is contained in:
parent
dc20ddf9b8
commit
02d4ab1a60
2 changed files with 21 additions and 1 deletions
|
@ -16,6 +16,26 @@ $email = "";
|
||||||
|
|
||||||
require_once('install_functions.php');
|
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 (isset($_GET['clean'])) {
|
||||||
if (is_dir('install')){
|
if (is_dir('install')){
|
||||||
delTree('install', true);
|
delTree('install', true);
|
||||||
|
|
|
@ -110,4 +110,4 @@ function executeQuery($handle, $sql, $params) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue