<?php
ini_set('session.cookie_domain', '.wauhaha.com');
session_start();
include("includes/site_info.php");
$Sess_UserId = $_SESSION['Sess_UserId'];
$Sess_UserName = $_SESSION['Sess_UserName'];
$query="UPDATE members SET timestamp='unix_timestamp(NOW())-1810' WHERE mem_userid=$Sess_UserId";
mysql_query($query,$link);
$query1="UPDATE members SET mem_online='N' WHERE mem_userid=$Sess_UserId";
mysql_query($query1,$link);
 $q = "DELETE FROM ".TBL_ACTIVE_USERS." WHERE username = '$Sess_UserName'";
      mysql_query($q);
mysql_close($link);
unset($_SESSION['Sess_UserId']);
unset($_SESSION['Sess_Userlevel']);
unset($_SESSION['Sess_LastVisit']);	
unset($_SESSION["Sess_UserName"]);
unset($_SESSION["Sess_UserType"]);
// Unset all of the session variables.
session_unset();
// Finally, destroy the session.
session_destroy();
setcookie ("WUsername_c", "", time()-3600,  "/", ".wauhaha.com");
setcookie ("WPassword_c", "", time()-3600,  "/", ".wauhaha.com");
echo "<script> location.href='$CONST_LINK_ROOT/index.php'</script>";
//header("Location: $CONST_LINK_ROOT");
exit;

?>