Location: PHPKode > projects > Spacemarc News > spacemarc-news/admin/logout.php
<?php

/*****************************************************************
*  Spacemarc News
*  Version: 1.2.0
*  Author and copyright (C): Marcello Vitagliano
*  Web site: http://www.spacemarc.it
*  License: GNU General Public License
*
*  This program is free software: you can redistribute it and/or
*  modify it under the terms of the GNU General Public License
*  as published by the Free Software Foundation, either version 3
*  of the License, or (at your option) any later version.
*
*  Current file: logout.php
*****************************************************************/
session_start();
require_once (dirname(__FILE__) . '/../config.php');
$db = mysql_connect($db_host, $db_user, $db_password);
mysql_select_db($db_name, $db);
@mysql_query("UPDATE $tab_utenti SET token=NULL, cookie=0 WHERE user_id=" . intval($_SESSION['user_id']));
mysql_close($db);
$_SESSION = array();
session_destroy();

if (isset($_COOKIE['session_name()'])) {
    setcookie(session_name() , '', time() - 3600);
}

if (isset($_COOKIE['accesso_news'])) {
    setcookie('accesso_news', '', time() - 3600);
}
header("Location: " . $dir_admin . "/login.php");
exit();
?>
Return current item: Spacemarc News