PHP, Cookies and www…oh my!

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!