Jump to content

Cookie not working as it should


ryanwood4

Recommended Posts

Hiya, I'm trying to set a cookie to last a good 150 days or 3600 hours. But the script below doesn't seem to be adding the cookie correctly. Sometimes members are logged in for a few hours, sometimes a day. But never more than a few days.

 

The part of the code which adds the cookie:

// if login is ok then we add a cookie
$_POST['email'] = stripslashes($_POST['email']); 
$hour = time() + 3600; 
setcookie(ID_my_site, $_POST['email'], $hour); 
setcookie(Key_my_site, $_POST['password'], $hour);

 

Anyone know why it isn't working correctly?

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/189652-cookie-not-working-as-it-should/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.