PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

ASP.NET - Logout from code

 
 
JackResteBienSurMaisSeraPas
Guest
Posts: n/a
 
      23rd Aug 2006
How do you logout from an account from the ASP.NET code?


 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      23rd Aug 2006
How are you logged in? If it uses forms authentication, use

FormsAuthentication.SignOut

http://msdn2.microsoft.com/en-us/lib...n.signout.aspx

Ken
Microsoft MVP [ASP.NET]

"JackResteBienSurMaisSeraPas" <(E-Mail Removed)>
wrote in message news:whNGg.5983$(E-Mail Removed)...
> How do you logout from an account from the ASP.NET code?
>



 
Reply With Quote
 
Patrick.O.Ige
Guest
Posts: n/a
 
      23rd Aug 2006
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]" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> How are you logged in? If it uses forms authentication, use
>
> FormsAuthentication.SignOut
>
>

http://msdn2.microsoft.com/en-us/lib...ormsauthentica
tion.signout.aspx
>
> Ken
> Microsoft MVP [ASP.NET]
>
> "JackResteBienSurMaisSeraPas" <(E-Mail Removed)>
> wrote in message news:whNGg.5983$(E-Mail Removed)...
> > How do you logout from an account from the ASP.NET code?
> >

>
>



 
Reply With Quote
 
dgk
Guest
Posts: n/a
 
      8th Sep 2006
On Wed, 23 Aug 2006 17:33:34 +1000, "Patrick.O.Ige"
<(E-Mail Removed)> wrote:

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


This seems to work well. Is there a reason not to use it?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shutdown, hibernate, sleep, logout, automatic logout. Katit Microsoft C# .NET 1 23rd Aug 2007 07:49 PM
Logout status doesn't really logout? =?Utf-8?B?dmE=?= Microsoft ASP .NET 1 26th Mar 2006 11:56 PM
I need code for logout and login with the vb Microsoft Access Security 2 7th Jun 2005 09:03 AM
I need code for logout and login with the vb Microsoft Access 0 5th Jun 2005 08:01 AM
Service containing managed code aborts on logout from console =?Utf-8?B?U3RldmUgQ3Jvc3NsZXk=?= Microsoft Dot NET Framework 0 24th Feb 2005 08:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:34 AM.