Jump to content

cookie difference


csckid

Recommended Posts

the time you set is when the cookie expires. when that expired time is reached, the cookie on the system's computer is removed.

 

time() - 3600 is in the past, so it basically deletes a cookie.

time() + 3600 is one hour in the future...so the cookie you set with it will last for 1 hour

 

you can use PHP SESSIONS to store information as the person navigates from page to page, but that SESSION only lasts until they close their browser. if you are looking for a "Remember Me" feature on a login page, you will need to use cookies

Link to comment
https://forums.phpfreaks.com/topic/150936-cookie-difference/#findComment-792963
Share on other sites

When you say session to use remember me tool, I assume that you mean making the session cookie last longer. You can do this using the function session_set_cookie_params. The only problem is that the session file on the server will expire after a set time. Therefore you can set other cookies containing and encrypted form of their username/userid and password. Or you can generate a string to be kept in a cookie that identifies them etc.

Link to comment
https://forums.phpfreaks.com/topic/150936-cookie-difference/#findComment-792967
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.