peter_anderson Posted March 20, 2010 Share Posted March 20, 2010 Hello there, I am in the process of coding a new ecommerce script, which loads the contents of the cart from the DB using the session ID. I'm now at the part where the user logs in. Once they've logged in, the session variables (storeactive and email) are set. However, this changed the session id. Is there any way to keep the session id the same, or any alternatives? Ideally, I don't want to rewrite too much. Thanks in advance Link to comment https://forums.phpfreaks.com/topic/195933-session-id-keep-the-same-after-adding-new-session-variable/ Share on other sites More sharing options...
teamatomic Posted March 20, 2010 Share Posted March 20, 2010 When the user logs in and is verified you can kill the session and start a new one for them using the retrieved ID. HTH Teamaotmic Link to comment https://forums.phpfreaks.com/topic/195933-session-id-keep-the-same-after-adding-new-session-variable/#findComment-1029199 Share on other sites More sharing options...
peter_anderson Posted March 20, 2010 Author Share Posted March 20, 2010 When the user logs in and is verified you can kill the session and start a new one for them using the retrieved ID. HTH Teamaotmic Thanks. I'm not sure how I would do that? The docs on sessions is pretty small. Could you give the peice of code to do this? I've set the system to POST the session id on the login form. Thanks Link to comment https://forums.phpfreaks.com/topic/195933-session-id-keep-the-same-after-adding-new-session-variable/#findComment-1029221 Share on other sites More sharing options...
peter_anderson Posted March 20, 2010 Author Share Posted March 20, 2010 The session ID did not change - it was a coding error on my behalf (was trying to select the sid from a non-existent column). Solved. Link to comment https://forums.phpfreaks.com/topic/195933-session-id-keep-the-same-after-adding-new-session-variable/#findComment-1029233 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.