LanceT Posted February 11, 2007 Share Posted February 11, 2007 So I want to set a cookie for more than one domain. If the cookie is set, it will recognize for both www.domain.com and sub.domain.com Is there a way to set a cookie like this? Link to comment https://forums.phpfreaks.com/topic/38040-setting-cookie-for-more-than-one-domain/ Share on other sites More sharing options...
almightyegg Posted February 11, 2007 Share Posted February 11, 2007 I just found this out myself set the cookie like this setcookie(cookie, $variable, time()+3600, '/', '.domain.com'); notice the . before the domain. That cookie will last for 1 hour Link to comment https://forums.phpfreaks.com/topic/38040-setting-cookie-for-more-than-one-domain/#findComment-182117 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.