smerny Posted May 16, 2010 Share Posted May 16, 2010 When I check my cookies, I have the right cookies under the URL www.example.com, BUT when I go to access my site, the 'www' is not always there (example.com) and when this is the case it does not pick up the cookies.... how can I fix this? Link to comment https://forums.phpfreaks.com/topic/201927-cookie-being-set-but-not-received-without-www/ Share on other sites More sharing options...
public-image Posted May 16, 2010 Share Posted May 16, 2010 could you post your cookie on the line that you use to set it so that I can see if I know what the problem is.. Link to comment https://forums.phpfreaks.com/topic/201927-cookie-being-set-but-not-received-without-www/#findComment-1059018 Share on other sites More sharing options...
smerny Posted May 16, 2010 Author Share Posted May 16, 2010 i mentioned how they are stored setcookie("display", $display, time()+60*60*24*365); Link to comment https://forums.phpfreaks.com/topic/201927-cookie-being-set-but-not-received-without-www/#findComment-1059025 Share on other sites More sharing options...
public-image Posted May 16, 2010 Share Posted May 16, 2010 setcookie("display", $display, time()+60*60*24*365, ".yoursite.com", ""); see if that helps Link to comment https://forums.phpfreaks.com/topic/201927-cookie-being-set-but-not-received-without-www/#findComment-1059026 Share on other sites More sharing options...
smerny Posted May 16, 2010 Author Share Posted May 16, 2010 now it shows up if i go to mysite.com, but not if i go to www.mysite.com Link to comment https://forums.phpfreaks.com/topic/201927-cookie-being-set-but-not-received-without-www/#findComment-1059027 Share on other sites More sharing options...
public-image Posted May 16, 2010 Share Posted May 16, 2010 setcookie("display", $display, time()+60*60*24*365, "/", ""); I use something like the above with the / but that has the with and without www. too although if you have cpanel access on your site im sure your allowed to permit whether everyone entering must have www. or not im sure its a feature. Link to comment https://forums.phpfreaks.com/topic/201927-cookie-being-set-but-not-received-without-www/#findComment-1059028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.