Another thing is that if you don’t specify a value for a cookie it will actually tell the browser to delete the cookie. Why there is no mention of this in Da Manual is beyond me. I’m pretty sure it used to be there, but now it’s not anymore?!
check also the path on the server in which your cookie will be available on, it is included on the documentation about setcookie() on the link posted above. remember that the default value is the current directory that the cookie is being set in.
Okay, I made a correction, checked the setcookie() $expire parameter, but discovered nothing incorrect in last one. So, now my code looks like this and still same problem - it just keeps redirecting like there is no cookie at all (even if I set the time() to +300 or something so it wouldn’t self-delete).