I login in my system and set a cookie this way:
setcookie('hello',true,time()+3600);
Then I look in the cookie manager of firefox and see that my cookie is set.
When I restart my browser and restart I see in the cookie manager that the cookie is ther but this code:
if(isset($_COOKIE['hello'])){ echo 'yes'; exit;}
I don’t see anything it redirects me to the login form. Does anyone know what’s going on?
Some things to try:
pathattribute ofsetcookieto/so the cookies are available in the entire domain.print_rof$_COOKIEin an otherwise empty PHP file.valuepart ofsetcookieexpects a string, not a boolean. I would imagine as it is right nowhellois being set to1, although this wouldn’t really matter on whether it is surviving a restart or not just thought I’d point it out.