summaryrefslogtreecommitdiffstats
path: root/web/html/logout.php
diff options
context:
space:
mode:
Diffstat (limited to 'web/html/logout.php')
-rw-r--r--web/html/logout.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/web/html/logout.php b/web/html/logout.php
index 45ab564e..fe8ffb01 100644
--- a/web/html/logout.php
+++ b/web/html/logout.php
@@ -10,16 +10,15 @@ include_once("acctfuncs.inc.php"); # access AUR common functions
# sending any HTML output.
#
if (isset($_COOKIE["AURSID"])) {
- $dbh = db_connect();
- $q = "DELETE FROM Sessions WHERE SessionID = '";
- $q.= db_escape_string($_COOKIE["AURSID"]) . "'";
- db_query($q, $dbh);
+ if (!$dbh) {
+ $dbh = db_connect();
+ }
+ delete_session_id($_COOKIE["AURSID"], $dbh);
# setting expiration to 1 means '1 second after midnight January 1, 1970'
setcookie("AURSID", "", 1, "/", null, !empty($_SERVER['HTTPS']), true);
unset($_COOKIE['AURSID']);
+ clear_expired_sessions($dbh);
}
-clear_expired_sessions();
-
header('Location: index.php');