No Free Time

Because my therapist says I need to let things out

One of those cookie quirks

Posted by andrewmyhre on January 12, 2009

Today I discovered a weird thing that happens if you’re creating an authentication cookie and you’re setting the domain of the cookie.

Let’s say my site is http://mysite.somedomain.com and I set the domain of the cookie to “mysite.somedomain.com”. If I attempt to log in the cookie won’t be saved, meaning I can’t log in. Setting the cookie domain to “somedomain.com” on the other hand works fine. Is this weird behaviour or am I just cookie-ignorant?

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>