Click to See Complete Forum and Search --> : Running a command after a certain time period


pilot1
11-02-2003, 06:18 AM
I'm using phpSecurePages (http://phpsecurepages.com) to force someone to enter a password before they enter my website.
However, they have access until they manually log out.
Is there a way to run the following code 10 minutes after they login?


<?PHP
$logout = true;
$cfgProgDir = 'phpSecurePages/';
include($cfgProgDir . "secure.php");
?>

I'm running Linix, and I've heard that I may need to set up a crontab to do it, but I don't know if that will work for logging users out.

Thanks!

pyro
11-02-2003, 05:53 PM
What does it user to keep user logged in? Cookies?

pilot1
11-02-2003, 06:20 PM
Yes, it uses cookies to keep them logged in.
The program is phpSecurePages (http://www.phpsecurepages.com)
Any ideas on how I can force them to logout after 10 minutes?

pyro
11-02-2003, 06:24 PM
Just set the cookies expiration time to time()+600 (10 minutes)...

pilot1
11-02-2003, 08:20 PM
The only place I could find that had the time function only pertained to php3, and I'm using php4.
Is there a way other than using time() that they could have set the cookie up with?

pyro
11-02-2003, 09:20 PM
time() (http://us3.php.net/manual/en/function.time.php) works fine in PHP4. If you show me the code that they use to set the cookie, I can show you how to set it up.

pilot1
11-03-2003, 03:09 PM
I'm not 100% sure, but I believe the attached file contains the script for setting up the cookies.
It wouldn't let me attach just the PHP file, so it's a zip file with the PHP file inside.
Thanks for your help!