Jump to content


cookie domain


2 replies to this topic

#1 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 20 January 2006 - 05:48 PM

when i set a cookie in the root folder for example, the cookie doesnt work for any oother folder. Aso when i try to delete a cookie set in the root in a different folder, the cookie will still work.

Will setting a domain for every cookie solve this?

#2 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 20 January 2006 - 05:52 PM

nevermind,
i shouldve looked at php.net/setcookie before i posted this thread.

so like this it will work on my whole domain?
setcookie("CoOoOokie", $variable, 3600, "/");


#3 veridicus

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 21 January 2006 - 03:30 PM

After the path parameter ("/") you should set the domain. Use ".domain.com" for it to apply to the domain and every subdomain. Use "www.domain.com" for it to only apply to the www subdomain.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users