PHP Sessions

I've asked a previous question on PHP sessions:

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.
LVL 43
RobOwner (Aidellio)Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
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.
RobOwner (Aidellio)Author Commented:
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.
RobOwner (Aidellio)Author Commented:
In the end I'm just setting the cookie manually outside of the CakePHP configuration.  It regenerates on every page load and is set to expire in one year.

setcookie('CAKEPHP', $this->Session->id(), time()+60*60*24*365, '/');

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RobOwner (Aidellio)Author Commented:
Overriding the cookie works the way I want it to.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.