Connecting Tech Pros Worldwide Forums | Help | Site Map

Forms Authentication

Boris Condarco
Guest
 
Posts: n/a
#1: Nov 17 '05
Hi,

I am working with forms authentication, so when the user leaves the
application pushing the exit option the program execute the following
instrucctions:

FormsAuthentication.SignOut()
Response.Redirect("login.aspx")

but, when the user leaves the application pushing the close button of the
navigator (placed at the right top of the screen) the instrucctions won't be
executed.

Is there any way to catch this event in order to make the execution of the
above instructions ??

I would really appreciate your helping me...!

Thanks in advance....!

Boris



Jim Cheshire
Guest
 
Posts: n/a
#2: Nov 17 '05

re: Forms Authentication


Boris,

That's a client-side event (onunload of the <body>) that you would capture,
and since HTTP is connectionless, you won't be able to run your code. You
can do it by having a client-side event take you to an ASPX page that runs
code to sign the user out, but you wouldn't want to do that because it
would run when the user navigates away from the page as well.

You're not going to be able to do this. You cannot rely on the Session_End
firing when the user closes the browser. In fact, it won't. It will only
fire when the session expires or if you call Session.Abandon.

Jim Cheshire
Developer Support
ASP.NET
jamesche@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------[color=blue]
>Reply-To: "Boris Condarco" <bcondarco@sbef.gov.bo>
>From: "Boris Condarco" <bcondarco@sbef.gov.bo>
>Subject: Forms Authentication
>Date: Tue, 29 Jul 2003 15:00:05 -0400
>Lines: 23
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
>Message-ID: <uSHgqcgVDHA.532@TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: 166.114.44.250
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:163109
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>
>Hi,
>
>I am working with forms authentication, so when the user leaves the
>application pushing the exit option the program execute the following
>instrucctions:
>
>FormsAuthentication.SignOut()
>Response.Redirect("login.aspx")
>
>but, when the user leaves the application pushing the close button of the
>navigator (placed at the right top of the screen) the instrucctions won't[/color]
be[color=blue]
>executed.
>
>Is there any way to catch this event in order to make the execution of the
>above instructions ??
>
>I would really appreciate your helping me...!
>
>Thanks in advance....!
>
>Boris
>
>
>[/color]

Boris Condarco
Guest
 
Posts: n/a
#3: Nov 17 '05

re: Forms Authentication


Thanks a lot guys for helping me to clear the concepts above

"Jim Cheshire (MS)" <jamesche@online.microsoft.com> wrote in message
news:YtIAMGhVDHA.1800@cpmsftngxa06.phx.gbl...[color=blue]
> Boris,
>
> That's a client-side event (onunload of the <body>) that you would[/color]
capture,[color=blue]
> and since HTTP is connectionless, you won't be able to run your code. You
> can do it by having a client-side event take you to an ASPX page that runs
> code to sign the user out, but you wouldn't want to do that because it
> would run when the user navigates away from the page as well.
>
> You're not going to be able to do this. You cannot rely on the[/color]
Session_End[color=blue]
> firing when the user closes the browser. In fact, it won't. It will only
> fire when the session expires or if you call Session.Abandon.
>
> Jim Cheshire
> Developer Support
> ASP.NET
> jamesche@online.microsoft.com
>
> This post is provided as-is with no warranties and confers no rights.
>
> --------------------[color=green]
> >Reply-To: "Boris Condarco" <bcondarco@sbef.gov.bo>
> >From: "Boris Condarco" <bcondarco@sbef.gov.bo>
> >Subject: Forms Authentication
> >Date: Tue, 29 Jul 2003 15:00:05 -0400
> >Lines: 23
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
> >Message-ID: <uSHgqcgVDHA.532@TK2MSFTNGP09.phx.gbl>
> >Newsgroups: microsoft.public.dotnet.framework.aspnet
> >NNTP-Posting-Host: 166.114.44.250
> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
> >Xref: cpmsftngxa06.phx.gbl[/color][/color]
microsoft.public.dotnet.framework.aspnet:163109[color=blue][color=green]
> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> >
> >Hi,
> >
> >I am working with forms authentication, so when the user leaves the
> >application pushing the exit option the program execute the following
> >instrucctions:
> >
> >FormsAuthentication.SignOut()
> >Response.Redirect("login.aspx")
> >
> >but, when the user leaves the application pushing the close button of the
> >navigator (placed at the right top of the screen) the instrucctions won't[/color]
> be[color=green]
> >executed.
> >
> >Is there any way to catch this event in order to make the execution of[/color][/color]
the[color=blue][color=green]
> >above instructions ??
> >
> >I would really appreciate your helping me...!
> >
> >Thanks in advance....!
> >
> >Boris
> >
> >
> >[/color]
>[/color]


Closed Thread