I am looking to change the length of time that the plugin stores the cookie and session. For example, some plugins will create a cookie that gets reset (destroyed) after 2 weeks. The same plugin might reset the cookie if the user’s session is closed.
My question is: where in the code does it say the length of time that these cookies are stored for?
My goal is have the cookie in place for a preset amount of time regardless of whether the computer or browser has shut down.
As another question, does anyone know of a good method that would force a browser (and possibly the computer) to remember the cookie regardless of whether or not the browser or computer was shut down?
You can use the ‘password_protected_auth_cookie_expiration’ filter to return a length of time for the cookie to last.
Thank you for your rapid response!
I just have a quick follow-up question. Does the cookie depend on the existence of the user’s session? For example, if the user accidentally closes all of their browsers or if they restarted their computer, will the cookie still be active?
Thank you very much for your help!
Currently the cookie only lasts for the current session until a user quits their browser. I could add in another filter to set a longer expiration for the cookie itself to persist across sessions if that is helpful?
- The topic ‘Cookie and Session time?’ is closed to new replies.