Jump to content

PHP session_id problems


solon

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/196103-php-session_id-problems/
Share on other sites

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.

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..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.