Logoff and terminate an ASP.NET session?

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
 
S

Steve C. Orr [MVP, MCSD]

Session.Abandon();
and it can help to avoid confusion by closing the browser window as well.
 
B

bmongtangco

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.
 
T

TR

Thanks. Seems almost too easy :) Garbage collector handles cleanup of
session variables?
TR
 
T

TR

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.
 
S

Steve C. Orr [MVP, MCSD]

would .SignOut() be called instead of Session.Abandon()?

No, use Session.Abandon also.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top