<?php
ini_set('session.cookie_domain', '.wowdoyou.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 all of the session variables.
session_unset();
// Finally, destroy the session.
session_destroy();

foreach($_COOKIE as $key => $value){
  setcookie($key, '', time()-42000, '/', ".wauhaha.com");
  unset($_COOKIE[$key]);
}
echo "<script> location.href='$CONST_LINK_ROOT/index.php'</script>";
exit;
?>