Jump to content

Recommended Posts

<meta http-equiv='refresh' content='x;somewhere.php' />
[/quote]

Where x is the seconds would send a user to somewhere.php x seconds after the page loaded.  If you're trying to log the user out after x seconds, that's a different story though.  You would need to expire the session.

Also, never trust anything client side.  A browser could easily ignore that meta tag and leave the client at that page.  If you're trying to make people logout after idle time, make their session expire or something, and then redirct the page.  Don't try to log them out by redirecting the page.

Just of curiosity, what's the purpose of this?  I might be able to answer better then, because I'm still not 100% what you're tryng to accomplish....  (02:19 might just be having a slow moment x.x.)

Link to comment
https://forums.phpfreaks.com/topic/95036-session-expiry/#findComment-486827
Share on other sites

use a session with the timeout period :)

 

Upon successful login

$_SESSION['timeout']=time()+15*60; // 15 minute timeout

 

than when u load a page check this timeout

 

if($_SESSION['timeout']<time()) {
     header("Location: login.php");  // If user timed out, send em back to loginpage
     session_destroy();  // Also remove his session variables;
     // remove any other Cookies or settings
    exit;
}
$_SESSION['timeout']=time()+15*60;  // Give User another 15 minutes

Link to comment
https://forums.phpfreaks.com/topic/95036-session-expiry/#findComment-486842
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.