0

I currently have an admin page but the session is only destroyed when the admin logs out. What I would like to do is destroy the session if the admin leaves a page that has sessions (e.g. admin.php) and goes onto a page without sessions (e.g index.php or a different website) how can this be done?

  • You'll never know if the user goes onto a different website unless that website calls some of your code. – h2ooooooo Apr 27 '14 at 12:30

1 Answers1

0

You should set the session_timeout to your desired value and be sure not to add 'session_start()' to your non-session pages, or explicitly log them out on those.

Community
  • 1
  • 1
Sherlock
  • 7,525
  • 6
  • 38
  • 79