Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i extend the cookie expiration time in php everytime i i regenerate the session id?

I have a session manager page: sessmgr.php. This page is supposed to validate the user log-in information, set the cookies and keep the session variables alive by updating the cookies expiration time and regenerating the session id by an XML HTTP request at regular intervals till the user logs out. I am able to update the session id but not extend the cookie expiration time.

How to update the cookie expiration time here ??

like image 586
Abhishek Avatar asked Dec 02 '13 11:12

Abhishek


1 Answers

You should be able to update the expiration time with setcookie like:

setcookie("Cookiename", $value, NewExpirationTime)

Check if the Cookiename is exactly the same so that the old Cookie will be overwritten.

like image 196
Marcel Balzer Avatar answered Oct 21 '22 00:10

Marcel Balzer