Logoff and terminate an ASP.NET session?

  • Thread starter Thread starter TR
  • Start date Start date
T

TR

What is the best practice for implementing a Logoff feature so that the
user's session is terminated and session state memory is released?
Thanks
TR
 
Session.Abandon();
and it can help to avoid confusion by closing the browser window as well.
 
if its signing out of forms, create a link to a page that have this
code....

Sub Page_Load
FormsAuthentication.SignOut()
End Sub

...and youre ready to go.
 
Thanks. We're not using Forms Auth at the moment, but would .SignOut() be
called instead of Session.Abandon()? The docs read "[The SignOut method]
removes either durable or session cookies." Is that synonymous with
terminating the session?
TR

bmongtangco said:
if its signing out of forms, create a link to a page that have this
code....

Sub Page_Load
FormsAuthentication.SignOut()
End Sub

..and youre ready to go.
 
would .SignOut() be called instead of Session.Abandon()?

No, use Session.Abandon also.
 
Back
Top