Forms Authentication

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Boris Condarco

    #1

    Forms Authentication

    Hi,

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

    FormsAuthentica tion.SignOut()
    Response.Redire ct("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

    #2
    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.53 2@TK2MSFTNGP09. phx.gbl>
    >Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
    >NNTP-Posting-Host: 166.114.44.250
    >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
    >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1631 09
    >X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
    >
    >Hi,
    >
    >I am working with forms authentication, so when the user leaves the
    >application pushing the exit option the program execute the following
    >instrucction s:
    >
    >FormsAuthentic ation.SignOut()
    >Response.Redir ect("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]

    Comment

    • Boris Condarco

      #3
      Re: Forms Authentication

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

      "Jim Cheshire (MS)" <jamesche@onlin e.microsoft.com > wrote in message
      news:YtIAMGhVDH A.1800@cpmsftng xa06.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.53 2@TK2MSFTNGP09. phx.gbl>
      > >Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
      > >NNTP-Posting-Host: 166.114.44.250
      > >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
      > >Xref: cpmsftngxa06.ph x.gbl[/color][/color]
      microsoft.publi c.dotnet.framew ork.aspnet:1631 09[color=blue][color=green]
      > >X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
      > >
      > >Hi,
      > >
      > >I am working with forms authentication, so when the user leaves the
      > >application pushing the exit option the program execute the following
      > >instrucction s:
      > >
      > >FormsAuthentic ation.SignOut()
      > >Response.Redir ect("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]


      Comment

      Working...