/    Sign up×
Community /Pin to ProfileBookmark

Running a command after a certain time period

I’m using [URL=http://phpsecurepages.com]phpSecurePages[/URL] 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?

[code]
<?PHP
$logout = true;
$cfgProgDir = ‘phpSecurePages/’;
include($cfgProgDir . “secure.php”);
?>
[/code]

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!

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@pyroNov 02.2003 — What does it user to keep user logged in? Cookies?
Copy linkTweet thisAlerts:
@pilot1authorNov 03.2003 — Yes, it uses cookies to keep them logged in.

The program is [URL=http://www.phpsecurepages.com]phpSecurePages[/URL]

Any ideas on how I can force them to logout after 10 minutes?
Copy linkTweet thisAlerts:
@pyroNov 03.2003 — Just set the cookies expiration time to time()+600 (10 minutes)...
Copy linkTweet thisAlerts:
@pilot1authorNov 03.2003 — 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?
Copy linkTweet thisAlerts:
@pyroNov 03.2003 — [URL=http://us3.php.net/manual/en/function.time.php]time()[/URL] 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.
Copy linkTweet thisAlerts:
@pilot1authorNov 03.2003 — 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!

[upl-file uuid=ba6b8822-ec63-4304-8247-b231b5b9f07d size=3kB]session.zip[/upl-file]
×

Success!

Help @pilot1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...