Browsing all articles in Cookies
Oct
27

PHP, Cookies and www…oh my!

Author Chris Cummings    Category Cookies, PHP     Tags

It always amazes me how many little “gotchas” there are in web design.  Here’s the sitch:

  1. Set a cookie using PHP at www.site.com/wordpress…set the cookie for the root: /
  2. Can read the cookie at www.site.com/wordpress
  3. Can NOT read the cookie at www.site.com/another_folder
  4. CAN read the cookie at site.com/another_folder (without the www)

After some digging found this article which shares how to set cookies so they can be accessed at www. or .

http://stackoverflow.com/questions/2345137/php-cookie-problem-www-or-without-www

Boo-ya!