Jump to content

Destroying Session


siri

Recommended Posts

Make sure you have that at the very bottom of the page and done have any content that is javascript and loads when the page loads, or it wont get done until the 60 seconds are over.First: the default time a php script can run before its stopped by the server is 30 seconds, but there is a function to raise this. Just google it :).Second: you need the close the unset parenthesis, because you are missing the end one ( unset($_SESSION['members']; is what you have, it should be unset($_SESSION['members']);It might be easier to just use session_destroy(); if you want to destroy all sessions.

Link to comment
Share on other sites

If you use the sleep function, you are going to make the user wait that long for the page to load. It would probably be best to use output buffering to explicitly send the page to the user, and then use the sleep function after it has been sent. But, if the user notices that the page hasn't finished loading and presses the stop button, it might never execute the statement to destroy the session. If you want this to apply to all session information, you can change the configuration option to have the session expire after 1 minute.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...