View Single Post
Old Jun 5th, 2005, 3:32 AM   #2
LiveWire
Newbie
 
LiveWire's Avatar
 
Join Date: Jun 2005
Location: Flordia
Posts: 5
Rep Power: 0 LiveWire is on a distinguished road
The way i did this on one of my scripts was, i had a global file. Inside that global file i used:

[php]
require_once('./functions/sessions.php');
[/php]

Now anytime a user clicked on a link the global file would run which would run the seesions.php file. Anyways, inside the sessions.php file there was a query that would run and set the last activity of the user, using the current time. Inside my admincp area i had a cookietimeout field that i can specifity x mintues.



Therefor you can do something similar to this
[php]
define('TIMENOW', time());
if (TIMENOW - $user['lastactivity'] > $admincp['cookietimeout'])
{
// destroy cookie settings here
}
[/php]

Hope this gets you on the right track.
__________________
I had a monumental idea this morning, but I didn't like it.
LiveWire is offline   Reply With Quote