|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ASP.NET - Logout from codeHow do you logout from an account from the ASP.NET code?
How are you logged in? If it uses forms authentication, use
FormsAuthentication.SignOut http://msdn2.microsoft.com/en-us/library/system.web.security.formsauthentication.signout.aspx Ken Microsoft MVP [ASP.NET] Show quote "JackResteBienSurMaisSeraPas" <JackResteBienSurMaisSera***@hotmail.com> wrote in message news:whNGg.5983$PR5.88501@wagner.videotron.net... > How do you logout from an account from the ASP.NET code? > Also to add to Kens post
You might need to make sure that none of the pages are cached. If you're using a master page, you can put the following code at the beginning of Page_Load Response.Expires = 60 Response.Expiresabsolute = Now() - 1 Response.AddHeader("pragma","no-cache") Response.AddHeader("cache-control","private") Response.CacheControl = "no-cache" Hope that helps Patrick "Ken Cox [Microsoft MVP]" <BANSPAMkjopc@newsgroups.nospam> wrote in message http://msdn2.microsoft.com/en-us/library/system.web.security.formsauthenticanews:#FwSYElxGHA.4876@TK2MSFTNGP05.phx.gbl... > How are you logged in? If it uses forms authentication, use > > FormsAuthentication.SignOut > > tion.signout.aspx Show quote > > Ken > Microsoft MVP [ASP.NET] > > "JackResteBienSurMaisSeraPas" <JackResteBienSurMaisSera***@hotmail.com> > wrote in message news:whNGg.5983$PR5.88501@wagner.videotron.net... > > How do you logout from an account from the ASP.NET code? > > > > On Wed, 23 Aug 2006 17:33:34 +1000, "Patrick.O.Ige"
<naijaco***@hotmail.com> wrote: >Also to add to Kens post This seems to work well. Is there a reason not to use it?>You might need to make sure that none of the pages are cached. If you're >using a master page, you can put the following code at the beginning of >Page_Load >Response.Expires = 60 >Response.Expiresabsolute = Now() - 1 >Response.AddHeader("pragma","no-cache") >Response.AddHeader("cache-control","private") >Response.CacheControl = "no-cache" > >Hope that helps >Patrick > |
|||||||||||||||||||||||