Jump to content

Cookie Length Question


Zepo.

Recommended Posts

Im not sure if its my browser doing this or what, but the cookie only seems to last as long as a session does. Heres the code.

Select

<select class='button' name='login[clength]'>
<option value='60'>1 Hour</option>
<option value='1440'>1 Day</option>
<option value='10080'>1 Week</option>
<option value='43200'>1 Month</option>
<option value='-1' selected='selected'>Forever</option>
</select>

 

Cookie Set

setcookie(tid, $getid[id], $login[clength]);
setcookie(user, $login[name], $login[clength]);
setcookie(pass, $login[pass], $login[clength]);

Link to comment
https://forums.phpfreaks.com/topic/82718-cookie-length-question/
Share on other sites

First you stated it expired when you closed the browser, now you say it lasted for a day.

 

Lets make sure variables are set.

 

If you echo $login[clength], what is the value when you set the cookie?

 

The time value is based on Seconds, it looks like you are treating it as minutes, thats why I added the extra 60* in there

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.