PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
i wanted to know is there a way to set session time out in php because i am developing a user authentication system where if the user presses log out then the session could be destroyed but if the user does not press it then how long will it take to log out and again sign in and how can i anage this problem .
Thanks
The standard session time out in php is set to "until the browser is closed." If you want to set this to something different you should first read the php manual http://php.net/manual/en/ref.session.php - there's a lot about the things you're asking
My session files are saved in temp directory and I am talking about cookies i also wanted to know how these files could be deleted automatically after session ends.
which doesn't mean the files vanish instantly after 1440 seconds.
How often php searches for old session files is controlled via session.gc_probability
cactus wrote:
The session_destroy() method should clean up your expired sessions, the default TTL is 1440 seconds.
Yes session_destroy() works great but instead of just going back to the index page or whatever I refresh to a kill page after destroying it. Then it refreshes to the page I want it to go to. This way You can not hit the back button and still have session.