Friday 15 June 2012

php - Setting cookie path to "/" does not make cookie accessible to entire site -


Why does the php cookie path do not work for each sub-devices in the domain "/", but only for current Directory.

Cookie is set:

  setkey ("name", "val", expire_time, "/");  

It just does not want to work.

Try domain parameters with:

  setcookie ("name" , "Val", expire_time, "/", ".domain.com"); // Do not forget the prefixing period: .domain.com  

which will enable all sudomains of "domain.com"


No comments:

Post a Comment