solon Posted March 22, 2010 Share Posted March 22, 2010 Hey guys... i have a login page and i use session id to keep track of what the user did before he logged in so i can carry his actions after he log's in. When i login the 1st time the session_id changes automatically... the second time it doesnt change and everything works. Does anyone had this problem before? if yes what might be the solution... Thanks in advance Solon Quote Link to comment https://forums.phpfreaks.com/topic/196103-php-session_id-problems/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 22, 2010 Share Posted March 22, 2010 Best guess is that your URL's changed from not having www. to having www. on them due to your redirects and you have not set up the session.cookie_domain to match all sub-domains/host-names of your domain and/or the same problem with the path in the URL and the session.cookie_path setting to match all paths on your site. It would take seeing your code and what URL's you are using to know for sure. Quote Link to comment https://forums.phpfreaks.com/topic/196103-php-session_id-problems/#findComment-1029940 Share on other sites More sharing options...
solon Posted March 22, 2010 Author Share Posted March 22, 2010 Thanks for your reply PFMaBiSmAd, That was actually my problem... i fixed it using $_SERVER['HTTP_HOST'] instead of the actual address so it gets the url used by the user on the URL bar. Thank you very much i would never guessed that was the problem.. Quote Link to comment https://forums.phpfreaks.com/topic/196103-php-session_id-problems/#findComment-1029991 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.