Normally a php session expires when the user closes the browser. Is is possible to create a session in php that never expires, doesn’t matter how many times user closes and restart the browser?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not strictly endless, but you can set the cookie lifetime to two years or so which comes pretty close:
session.cookie-lifetimeini settingsession_set_cookie_params()Docs function to set them programmatically.The session cookie won’t be deleted then if the user closes the browser.
Take care that your session data store keeps the data as well that long. This is important. And keep in mind that you need to store all user’s data for this large time-span, so you should have enough space available.
This does not work at all if the user disables cookies in her or his browser.