Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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