po/POTFILES: Fix library file paths
[aur.git] / web / html / logout.php
blob1cdf453da3793b07c86122d1594551b5a75b9c5d
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 $dbh = db_connect();
14 $q = "DELETE FROM Sessions WHERE SessionID = '";
15 $q.= mysql_real_escape_string($_COOKIE["AURSID"]) . "'";
16 db_query($q, $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']);
22 clear_expired_sessions();
24 header('Location: index.php');