RE: forms authentication automatic logout without timers?
From: ranganh (ranganh_at_discussions.microsoft.com)
Date: 06/30/04
- Previous message: Danny: "forms authentication automatic logout without timers?"
- In reply to: Danny: "forms authentication automatic logout without timers?"
- Next in thread: Sam: "forms authentication automatic logout without timers?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 29 Jun 2004 22:09:01 -0700
Dear Danny,
In the Page_Load event of the page where you want to logout the users, put the following code:-
if(User.Identity.IsAuthenticated)
{
FormsAuthentication.Signout();
}
this will automatically signout user's who are logged in.
hope it helps.
"Danny" wrote:
> Hello,
>
> I have a web application that uses forms authentication. I have been asked to implement a feature that logs users out automatically if they navigate to a page outside of the secured portion of the web app. This request means that cookie timeouts won't work, it needs to be an instant thing - you leave the site -> the door gets locked on your way out even if you haven't explicitly logged out yourself.
>
> Does anyone know if this is possible?
>
> Regards,
>
> Danny
- Previous message: Danny: "forms authentication automatic logout without timers?"
- In reply to: Danny: "forms authentication automatic logout without timers?"
- Next in thread: Sam: "forms authentication automatic logout without timers?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]