Add database wrapper class and new connection method
[aur.git] / web / html / logout.php
blob2d8bebc675ef8bf59fde4b6773f56e6357efcaa5
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: /');