View Single Post
  #1  
Old 10th September 2019, 22:01
bizzarre13 bizzarre13 is offline
Member
 
Join Date: Apr 2013
P2P
Posts: 10
Default terminate users session
I want to terminate all users session after a perion of time, let's say 24h
I have this in bittorrent.php
Code:
function logincookie($id, $passhash, $updatedb = 1, $expires = 0x7fffffff)
{
        setcookie("uid", $id, $expires, "/");
        setcookie("pass", $passhash, $expires, "/");

  if ($updatedb)
          mysql_query("UPDATE users SET last_login = NOW() WHERE id = $id");
}
Tried to change $expires like this:
Code:
function logincookie($id, $passhash, $updatedb = 1, $expires = 0x15180)
{
        setcookie("uid", $id, $expires, "/");
        setcookie("pass", $passhash, $expires, "/");

  if ($updatedb)
          mysql_query("UPDATE users SET last_login = NOW() WHERE id = $id");
}
But it's not working. If i put any other value instead of 0x7fffffff , it will fail. Instead of redirecting me to my account, it redirects me again to login.php .
It's working only with 0x7fffffff value.
Maybe is another function to terminate all users session after a specific period?
Reply With Quote