how does your login work tell me and ill give you the auto logout code hard to just tell you without knowing your code its a 30 coding job
Autu Logout?
Collapse
X
-
Guest -
Guest
eg on ws i used a sessions system and last seen field in the database lastseen is updated everytime someone loads a page and is unique for every user i then just deleted all session ids from database where lseen was more than the total inactive time
Comment
-
Guest -
Guest
yes post if ill give you new php to add to your script and sql and it will make auto logout what query do you use
Comment
-
Guest
ok here is sql to alter your online table use it in phpmyadmin
Add this functionCode:ALTER TABLE `online` ADD `lseen` INT( 255 ) NOT NULL DEFAULT '0';
Code:function update_timeout($user){ $currenttime = time(); mysql_query("UPDATE online SET lastseen='$currenttime' WHERE user='$user'"); $limit = 420; //timout in seconds (420 seconds is 7 mins) $userlseen = time()-$limit; mysql_query("DELETE FROM online WHERE lseen < $userlseen"); }
I havn't tested this for errors so any problems then post here
to use afer adding use
$user is the var containg of the person that is logged in put it in main menu or a page that is updated frequentlyCode:update_timeout($user);
Comment

Comment