Thursday, December 13, 2012

Cookies in Local Host


The cookie specs require two names and a dot between, so your cookiedomain cannot be "localhost". Here's how I solved it:
  1. Add this to your %WINDIR%\System32\drivers\etc\hosts file: 127.0.0.1 dev.livesite.com
  2. When developing you use http://dev.livesite.com instead of http://localhost
  3. Use ".livesite.com" as cookiedomain (with a dot in the beginning) when creating the cookie.
  4. Now it works on all sites:

No comments: