0

I'm trying to set the cookie domain for local URLs such as http://local-myproject and http://en.local-myproject, etc:

ini_set('session.cookie_domain', '.local-myproject');

But when I check whether the PHPSESSID cookie was written for this domain, it is missing. Only when I remove this line does the cookie appear. But, I want to be able to share the cookie across subdomains. Does my browser (Chrome and FF) not like this value .local-myproject as a cookie domain? Does it have to be a valid URL? e.g. local-myproject.com (I could always create these for all my projects in /etc/hosts)

Martyn
  • 6,031
  • 12
  • 55
  • 121
  • It should work fine. Are you using a linux server with Suhosin? If so, check out the answers/comments here http://stackoverflow.com/q/644920/1301076 – rjdown Feb 20 '15 at 05:08
  • No, doesn't appear to use it. I tried on my home laptop too and have the same issues. Strange. – Martyn Feb 21 '15 at 10:36

0 Answers0