On my website I set some cookies when users login so I can remember them so they don't have to login every time they re-visit the website.
I set the cookies in php using the following code:
setcookie("last_login", $loginID, time() + (86400 * 30), "/"); // 86400 = 1 day
And in my php.ini I even got this setting:
session.cookie_lifetime = 2592000
But even with all this when i close down the browser and re-open the website the cookies don't work in my php code and they dose not get logged in, but even more weird. Then when i try yo echo the cookie using:
echo $_COOKIE["last_login"];
It in the begining does not show up but sometimes after a few reloads it just randomly starts working with the cookie and it echo it out and you get logged in...?
So how can i make it so the cookies allways work within the next 30 days without it being weird?