Jump to content

Recommended Posts

There are a lot of topics that explain how to change the session lifetime for a application but for some reason I'm to stupid to make it work, and can't for the life of me figure out why...

 

I want to extend the lifetime of a session with 2 hours of inactivity.

 

So that the session remains active upto 2 hours after the last action of the user.

 

I've tried this with .htaccess setting the lifetime and maxlifetime to 7200 which killed the session after exactly 2 hours (Not what I wanted)

Removing the maxlifetime setting results in the same effect.

 

I've added the ini_set params for lifetime to the same, also without effect.

I've added a setcookie function to each request to reset the lifetime of the session, with no success...

 

what am I doing wrong?

and are there any other ways to resolve this?

 

Thanks to anyone for advice on this matter.

Link to comment
https://forums.phpfreaks.com/topic/279509-changing-session-lifetime/
Share on other sites

setting the lifetime and maxlifetime to 7200 which killed the session after exactly 2 hours

 

if the session was still active upto/before the 2 hour limit and the last access time was refreshed/updated when you accessed a page containing a session_start() statement, then that did exactly what you wanted. if that statement means something else, you would need to clarify what it did that wasn't what you wanted.

 

it would also help if you showed the exact settings/code you tried in case there's something wrong with the usage. also, any chance that you executed a session_start() that didn't have the settings present before the session_start() statement, so that the default settings took effect?

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.