Jump to content

cookie inconsistency


jimmyo

Recommended Posts

Hello and thank you in advance for any help you can provide; I have looked through the help files and was unable to find an answer to the specific problem I'm having. 

 

I am using the 'setcookies' command and am finding that sometimes my cookies are set and sometimes they are not.  I've narrowed things down such that if an end-user enters the site via http://www.xxx.com (where xxx is my domain) and cookies are set, and then re-enters the site later via http://xxx.com the cookies are not found.  Is there a way to ensure that the cookies can be read in all cases (ie both set and read from either 'entry point').  Thank you.

 

...Jim

 

 

Link to comment
https://forums.phpfreaks.com/topic/150748-cookie-inconsistency/
Share on other sites

Yes there is. Please read the setcookie page in the php manual and you will find that there is a domain parameter that needs to be used. You might also want to use the path parameter so that the cookie is available within different paths as well.

Link to comment
https://forums.phpfreaks.com/topic/150748-cookie-inconsistency/#findComment-792006
Share on other sites

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.