How can I set a web application to have an infinite session, so that the user doesn't get logged out after some time, even if the web application stays open for years ?
Asked
Active
Viewed 99 times
0
-
1Why are you trying to do this? – RonaldBarzell Dec 06 '12 at 13:56
-
1session time can be set in php.ini I am not sure if there is an upper limit tho. Of course if the server is restarted they are removed. – NappingRabbit Dec 06 '12 at 14:00
-
This might help you out. – ameyav Dec 06 '12 at 14:25
2 Answers
0
I think you should use COOKIE rather than SESSION, since SESSION only persists until browser is closed
or perhaps you might consider localStorage for HTML 5

willsantoso
- 137
- 1
- 1
- 9
0
It is not possible to set infinite SESSION
on server-side because the session information is constantly deleted and creates new session accordingly
By using the function session_set_cookie_params
we can set lifetime of the session cookie in seconds.
Refer to this : http://php.net/manual/en/function.session-set-cookie-params.php

laxonline
- 2,657
- 1
- 20
- 37