alex3 Posted September 20, 2009 Share Posted September 20, 2009 I have a cookie with three values: $_COOKIE['Site Name']['session'],['token'],['user'] If a user wants to be remembered, a unique token is generated and added to the users row in a DB. When a user revisits the site (revisit = after the user's previous session ID has expired) the token and username values are looked up in the DB, if they exist the user is trusted and a session value is created (equal to session_id()) in the cookie. The session value is the first thing to be checked to prevent lots of DB lookups. If the session value is equal to session_id(), the user is trusted, if not then we check the values of 'user' and 'token'. The crux is that whenever the token value is looked up, it is replaced with a new value (to prevent cookies being stolen and used). I want to update the user's cookie to reflect this new token value, but I don't know how to while keeping the cookie expiry date intact. How can I do this? Link to comment https://forums.phpfreaks.com/topic/174906-can-a-cookies-value-be-modified-without-changing-its-expiry-date/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.