Recommended Answers
Jump to PostMaybe you should explain why you need to do this. Normally, the session will terminate automatically when the browser is closed.
Jump to PostIf you have a login process, then you need to have a timed process that checks if an account is still active/online and if they aren't then you automatically log them out. You could do this every 15 minutes and any account that is logged-in but inactive would be logged …
Jump to PostWhat are you currently setting the cookies' expiration date to? If you don't set it to anything, then they will expire automatically when the browser closes.
If you're trying to automatically log the client out after, say, 15 minutes of inactivity, then you will need a system to monitor …
Jump to PostSave a session variable called $_SESSION with time() value every time a page is viewed.
BUT, check first check to see if the current time (time()) is within 15 minutes (900). If so, store the new time, otherwise unset all session data and logout / redirect whatever.
Perhaps …
All 13 Replies

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.