logout.php: Fix PHP undefined variable notice
[aur.git] / web / html / logout.php
blob3d059e701963113f9631d2c674b2db9c9a842c2c
1 <?php
3 set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
5 include_once("aur.inc.php"); # access AUR common functions
6 include_once("acctfuncs.inc.php"); # access AUR common functions
9 # if they've got a cookie, log them out - need to do this before
10 # sending any HTML output.
12 if (isset($_COOKIE["AURSID"])) {
13 if (!isset($dbh)) {
14 $dbh = db_connect();
16 delete_session_id($_COOKIE["AURSID"], $dbh);
17 # setting expiration to 1 means '1 second after midnight January 1, 1970'
18 setcookie("AURSID", "", 1, "/", null, !empty($_SERVER['HTTPS']), true);
19 unset($_COOKIE['AURSID']);
20 clear_expired_sessions($dbh);
23 header('Location: /');