Jump to content

session


pranshu82202

Recommended Posts

Yeah thats true.. whenever user leaves the site the session expires....

 

But what if the user opened the website and leave it... then for how much time session will be valid....

 

And how can i change its time.... that after 5 min when user will refreshed he logged in will he will be logged out.....

Link to comment
Share on other sites

You can also delete the actual session file if you know exactly where it is (you can set the path where the session files are stored in php.ini). I use this on my intranets when I want to force a user to be logged out.

 

when they login I store their session id:

session_start();
$sid = 'sess_'.session_id();

 

and to force logout I use something like this:

$file = '/phpsessions/'.$sid;
if(is_file($file)){
unlink($file);
}

 

Link to comment
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.