|
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.
|