mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 09:43:03 +00:00
Improve cookie handling
* Remove comment that is mostly bogus- the domain is automatically set. * When logging out, don't delete the language cookie. * Make the language cookie persistent. * Use the minimal time possible to expire cookies; no need to compute anything. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
90485e8f42
commit
984ce9529c
2 changed files with 11 additions and 14 deletions
|
@ -14,8 +14,9 @@ if (isset($_COOKIE["AURSID"])) {
|
|||
$q = "DELETE FROM Sessions WHERE SessionID = '";
|
||||
$q.= mysql_real_escape_string($_COOKIE["AURSID"]) . "'";
|
||||
db_query($q, $dbh);
|
||||
setcookie("AURSID", "", time() - (60*60*24*30), "/");
|
||||
setcookie("AURLANG", "", time() - (60*60*24*30), "/");
|
||||
# setting expiration to 1 means '1 second after midnight January 1, 1970'
|
||||
setcookie("AURSID", "", 1, "/");
|
||||
unset($_COOKIE['AURSID']);
|
||||
}
|
||||
|
||||
clear_expired_sessions();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue