Security : clean cookie and global variables when logging out
This commit is contained in:
parent
bca89e2765
commit
19e6e8ca6d
1 changed files with 16 additions and 0 deletions
|
|
@ -27,6 +27,22 @@ require_once('lib/class_database.php');
|
|||
html_page_start("classic");
|
||||
|
||||
session_unset();
|
||||
/* clean Global variable */
|
||||
|
||||
if ( isset ($g_user) ) unset ($GLOBAL['g_user']);
|
||||
if ( isset ($g_pass) ) unset ($GLOBAL['g_pass']);
|
||||
//
|
||||
// Clean the possible cookies
|
||||
//
|
||||
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, '/');
|
||||
}
|
||||
}
|
||||
echo '<h2 class="info">'._('Vous êtes déconnecté').'</h2>';
|
||||
echo '<META HTTP-EQUIV="REFRESH" content="0;url=index.html">';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue