On one page I have something like this
setcookie('user', 'value' ,6000, '/', 'mydomain.co.uk');
On the subsequent page I have
var_dump($_COOKIE);
I can see all the automatically generated ones, like PHPSESSID but I cannot see user.
If I do echo setcookie('user', 'value' ,6000, '/', 'mydomain.co.uk'); it returns true. So I’m not sure why I can’t see it.
I have tried a lot of different ideas, but nothing has worked. Also, I have using .htaccess to redirect all requests via one page index.php not sure if this is doing anything.
Try this:
The expires Parameter needs to be a timestamp.
6000as a timestamp is in the past and therefore removes the cookie.