Jump to content

Recommended Posts

Sessions are probably your best bet. By using a cookie to store the login session, you can also set how long it's good for. So if they try to come back and the time limit has expired, they will not be logged in. I have never done it before, so I can't offer any concrete verbiage as to what exactly goes on.

 

The same can be true for if someone leaves the page open. If the cookie is only good for so long, whenever they try to move to another page, then they won't have access to it because they will no longer be logged in.

Link to comment
https://forums.phpfreaks.com/topic/105419-timeout/#findComment-539869
Share on other sites

To expound on charlieholder's thoughts, my scripts use a $_SESSION variable, so as long as they keep the browser open, they will be logged in.  When the browser closes the session is over, so they are logged out.  If you want them to be logged in for as long as they want, you need to use an infinite cookie, or something like that.

Link to comment
https://forums.phpfreaks.com/topic/105419-timeout/#findComment-539873
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.