Link to home
Start Free TrialLog in
Avatar of Rob
RobFlag for Australia

asked on

PHP Sessions

I've asked a previous question on PHP sessions: https://www.experts-exchange.com/questions/28447891/cakePHP-Sessions.html

Why is my PHP session cookie's lifetime is not being updated with each page refresh even though I can see the session information on the server is being extended?

This is using CakePHP but to my knowledge it uses PHP sessions.
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

A session cookie's lifetime is 0, zero, which tells the browser that it is a 'session cookie' and should be 'expired' when the browser closes all windows and exits.  There isn't anything to update if it is set as a session cookie.  

This is entirely independent of the session timeout on the server which is reset with every page request.
Avatar of Rob

ASKER

Ok then it's not a session cookie in that sense.  This is a cookie that represents a session on the server.  It has an expiry that I need to be updated so that the user is not halfway through doing something when the session expires.  It should update the cookie with a new timeout with every page refresh.

think of it like a "remember me" cookie.
ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rob

ASKER

Overriding the cookie works the way I want it to.