newman Posted September 5, 2006 Share Posted September 5, 2006 hi all . i've got a problem with cookies .when i add www in my URL the cookies do not work .1 ) http://mydomain.com ( cookies work )2 ) http://www.mydomain.com ( cookies do not work )have anyone had this problem ?thanks in advance . Link to comment https://forums.phpfreaks.com/topic/19813-problem-with-cookie/ Share on other sites More sharing options...
newman Posted September 6, 2006 Author Share Posted September 6, 2006 can anyone help ? Link to comment https://forums.phpfreaks.com/topic/19813-problem-with-cookie/#findComment-87040 Share on other sites More sharing options...
ToonMariner Posted September 6, 2006 Share Posted September 6, 2006 hwat parameters are you passing to the setcookie function? Link to comment https://forums.phpfreaks.com/topic/19813-problem-with-cookie/#findComment-87047 Share on other sites More sharing options...
arianhojat Posted September 6, 2006 Share Posted September 6, 2006 http://www.php.net/manual/en/function.setcookie.phpdomain argument for setcookie: "To make the cookie available on all subdomains of example.com then you'd set it to '.example.com'. The . is not required but makes it compatible with more browsers. Setting it to www.example.com will make the cookie only available in the www subdomain"so to make it work for everything, maybe try ".mydomain.com" as the domain argument in setcookie() Link to comment https://forums.phpfreaks.com/topic/19813-problem-with-cookie/#findComment-87053 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.