mardi 19 décembre 2017

PHP cookie not found

I have a website where a php script creates a cookie and calls another php code which reads that cookie. However there is weird problem which I am facing and I will use an example to state it. Assume my website name is www.example.com

In this site www.example.com a php cookie is created. Then it redirects to another php for e.g. http://ift.tt/2BNxGvC and this cookie uses the $_cookie to read it. The problem is if user opens site using www then everything works (for e.g www.example.com) however if he uses http://example.com & then the other application is unable to find the cookie. In browser cookie inspector i see cookie is created always under www.example.com

Is there a way to solve this otherwise I have to tell people to use www always. Thank you.




Aucun commentaire:

Enregistrer un commentaire