I have some trouble understanding why setcookie()
doesn't work on several pages.
if (isset($_POST['group'])){
$group = stripslashes($_POST['group']);
setcookie(GSgroup, $group, time()+3600);
}
I use the above code to set a cookie when a form is posted with several options. I use this on an included page so that all pages which use this function will set the cookie to the right group.
Now, this worked perfectly fine when I tried it on localhost
, but after uploading it to a live website it doesn't work anymore. The strange thing is, that after I used it on another included page it did work.
Does anyone have any clue how this could be? I am really confused.
If you need more information please ask.