Close Sessions & database closing

Hello all,

A couple of questions:

  1. When does the Session.Close event fire?
  2. Where is the best place to close an opened database?
  3. What is the best practice for ending a session, so that the browser displays the “application has gone off line” or similar?

Thanks,
Tim

The best practice for ending a session is to redirect the user away from your app. The session will automatically die off 3 minutes after that.

Hi Greg.

So just before sending it to a different URL, do all of the cleanup work etc. What happens if the user hits the back button?

Thanks for your response Greg!
Tim

[quote=276876:@Tim Seyfarth]Hi Greg.

So just before sending it to a different URL, do all of the cleanup work etc. What happens if the user hits the back button?

Thanks for your response Greg!
Tim[/quote]
No. Just leave it. Session.Close will fire when the session actually closes. That’s when you do the cleanup. If the user presses the back button, it’ll still be there for them.

Thanks for the clarity Greg!
Tim