forms authentication not authenticating

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Greg Burns

    #1

    forms authentication not authenticating

    I have built a web app that uses forms authentication. There isn't a
    "remember me" feature (i.e. the authentication cookie is not permanent).
    When you close the browser, and open a new one, you must log in again. This
    is the behavior I expected.

    I just discovered that if I have a browser window open (to anything) prior
    to opening my web app in a new browser window, it appears to share session
    information. I can then open and close my web app over and over and it
    never makes me log in after the very first time if that first browser window
    (which isn't even part of my app) remains open.

    It there anything I can do about this?

    Thanks,
    Greg


  • Tian Min Huang

    #2
    RE: forms authentication not authenticating

    Hi Greg,

    It is really strange since the browser has no relation to the asp.net web
    application. Anyway, please check out your web.config file to see if there
    is anything wrong.

    Also, I suggest you try the steps in this article to create a form based
    authentication asp.net web app. Please test on this new web app to see if
    you could repro the problem.
    "HOW TO: Implement Forms-Based Authentication in Your ASP.NET Application
    by Using Visual Basic .NET"
    http://support.microsoft.com/?id=308157

    Regards,

    HuangTM
    Microsoft Online Partner Support
    MCSE/MCSD

    Get Secure! ¨C www.microsoft.com/security
    This posting is provided ¡°as is¡± with no warranties and confers no rights.


    Comment

    • Greg Burns

      #3
      Re: forms authentication not authenticating

      I did some more testing.

      Try this to duplicate the problem:

      Open a site that uses forms authentication. In my test I am using the
      IBuySpy portal.

      Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.


      Create account and sign in (do not check the remember login box). Creating
      a shortcut on desktop (I think this is the important piece.) to the web
      site.

      Close all browser windows.

      Open a new browser window to something (say www.yahoo.com)

      Leave that window open, double click on the shortcut to IBuySpy portal.
      Sign-in again. Close browser, leaving Yahoo open in first browser.
      Double-click shortcut to IBuySpy again. Notice, you are still logged in!
      Close window, repeat ad nauseam. :^)

      Thanks,
      Greg



      "Tian Min Huang" <timhuang@onlin e.microsoft.com > wrote in message
      news:oswAdEoUDH A.2152@cpmsftng xa06.phx.gbl...[color=blue]
      > Hi Greg,
      >
      > It is really strange since the browser has no relation to the asp.net web
      > application. Anyway, please check out your web.config file to see if there
      > is anything wrong.
      >
      > Also, I suggest you try the steps in this article to create a form based
      > authentication asp.net web app. Please test on this new web app to see if
      > you could repro the problem.
      > "HOW TO: Implement Forms-Based Authentication in Your ASP.NET Application
      > by Using Visual Basic .NET"
      > http://support.microsoft.com/?id=308157
      >
      > Regards,
      >
      > HuangTM
      > Microsoft Online Partner Support
      > MCSE/MCSD
      >
      > Get Secure! ¨C www.microsoft.com/security
      > This posting is provided ¡°as is¡± with no warranties and confers no[/color]
      rights.[color=blue]
      >
      >[/color]


      Comment

      • Greg Burns

        #4
        Re: forms authentication not authenticating

        You can do the same thing by opening a browser window, then opening a a new
        window from it (CTRL-N).

        I am sure this is just the way it works, but it was confusing at first. Am
        I correct in saying, it is because all these windows are sharing the same
        session ID, hence the same authentication cookie? (I can see that they
        are.)

        I guess, double-clicking on a shortcut to a web site does the same thing as
        a CTRL-N. Ie., it does not launch a new session. Bummer.

        Thanks,
        Greg


        "Jim Cheshire (MS)" <jamesche@onlin e.microsoft.com > wrote in message
        news:OFQmsOUVDH A.2000@cpmsftng xa06.phx.gbl...[color=blue]
        > Hi Greg,
        >
        > I can reproduce this issue easily. I am looking into it for you.
        >
        > 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]
        > >From: "Greg Burns" <greg_burns@hot mail.com>
        > >References: <#TWEU8gUDHA.22 84@TK2MSFTNGP11 .phx.gbl>[/color]
        > <oswAdEoUDHA.21 52@cpmsftngxa06 .phx.gbl>[color=green]
        > >Subject: Re: forms authentication not authenticating
        > >Date: Mon, 28 Jul 2003 10:20:37 -0400
        > >Lines: 55
        > >X-Priority: 3
        > >X-MSMail-Priority: Normal
        > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
        > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
        > >Message-ID: <#E1jsNRVDHA.21 04@TK2MSFTNGP10 .phx.gbl>
        > >Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
        > >NNTP-Posting-Host: 146.145.213.7
        > >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
        > >Xref: cpmsftngxa06.ph x.gbl[/color][/color]
        microsoft.publi c.dotnet.framew ork.aspnet:1626 04[color=blue][color=green]
        > >X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
        > >
        > >I did some more testing.
        > >
        > >Try this to duplicate the problem:
        > >
        > >Open a site that uses forms authentication. In my test I am using the
        > >IBuySpy portal.
        > >
        > >http://www.asp.net/IBS_Portal/DesktopDefault.aspx
        > >
        > >Create account and sign in (do not check the remember login box).[/color][/color]
        Creating[color=blue][color=green]
        > >a shortcut on desktop (I think this is the important piece.) to the web
        > >site.
        > >
        > >Close all browser windows.
        > >
        > >Open a new browser window to something (say www.yahoo.com)
        > >
        > >Leave that window open, double click on the shortcut to IBuySpy portal.
        > >Sign-in again. Close browser, leaving Yahoo open in first browser.
        > >Double-click shortcut to IBuySpy again. Notice, you are still logged in!
        > >Close window, repeat ad nauseam. :^)
        > >
        > >Thanks,
        > >Greg
        > >
        > >
        > >
        > >"Tian Min Huang" <timhuang@onlin e.microsoft.com > wrote in message
        > >news:oswAdEoUD HA.2152@cpmsftn gxa06.phx.gbl.. .[color=darkred]
        > >> Hi Greg,
        > >>
        > >> It is really strange since the browser has no relation to the asp.net[/color][/color][/color]
        web[color=blue][color=green][color=darkred]
        > >> application. Anyway, please check out your web.config file to see if[/color][/color]
        > there[color=green][color=darkred]
        > >> is anything wrong.
        > >>
        > >> Also, I suggest you try the steps in this article to create a form[/color][/color][/color]
        based[color=blue][color=green][color=darkred]
        > >> authentication asp.net web app. Please test on this new web app to see[/color][/color][/color]
        if[color=blue][color=green][color=darkred]
        > >> you could repro the problem.
        > >> "HOW TO: Implement Forms-Based Authentication in Your ASP.NET[/color][/color][/color]
        Application[color=blue][color=green][color=darkred]
        > >> by Using Visual Basic .NET"
        > >> http://support.microsoft.com/?id=308157
        > >>
        > >> Regards,
        > >>
        > >> HuangTM
        > >> Microsoft Online Partner Support
        > >> MCSE/MCSD
        > >>
        > >> Get Secure! ¨C www.microsoft.com/security
        > >> This posting is provided ¡°as is¡± with no warranties and confers no[/color]
        > >rights.[color=darkred]
        > >>
        > >>[/color]
        > >
        > >
        > >[/color]
        >[/color]


        Comment

        • Jim Cheshire

          #5
          Re: forms authentication not authenticating

          Greg,

          That's exactly what's happening. When you are using Forms authentication
          and an unpersistant cookie, the cookie is in-memory. Apparently, Internet
          Explorer is sharing that memory space when the window is opened via the
          shortcut icon or a Ctrl-N. This is expected when you are using Ctrl-N or
          Window, New Window. Obviously if that didn't share session state with the
          original window, it would be undesirable for an Internet developer. (That
          would also mean that a client-side window.open or a _blank target attribute
          would also lose session state.)

          This is by-design, although it may be counter-intuitive at first and may
          provide undesirable results at times. The solution in your case is to make
          sure that your Forms authentication ticket expires within a relatively
          short timeframe.

          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]
          >From: "Greg Burns" <greg_burns@hot mail.com>
          >References: <#TWEU8gUDHA.22 84@TK2MSFTNGP11 .phx.gbl>[/color]
          <oswAdEoUDHA.21 52@cpmsftngxa06 .phx.gbl>
          <#E1jsNRVDHA.21 04@TK2MSFTNGP10 .phx.gbl>
          <OFQmsOUVDHA.20 00@cpmsftngxa06 .phx.gbl>[color=blue]
          >Subject: Re: forms authentication not authenticating
          >Date: Mon, 28 Jul 2003 17:18:11 -0400
          >Lines: 112
          >X-Priority: 3
          >X-MSMail-Priority: Normal
          >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
          >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
          >Message-ID: <e$NgB3UVDHA.32 32@tk2msftngp13 .phx.gbl>
          >Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
          >NNTP-Posting-Host: 146.145.213.7
          >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
          >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1627 71
          >X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
          >
          >You can do the same thing by opening a browser window, then opening a a new
          >window from it (CTRL-N).
          >
          >I am sure this is just the way it works, but it was confusing at first. Am
          >I correct in saying, it is because all these windows are sharing the same
          >session ID, hence the same authentication cookie? (I can see that they
          >are.)
          >
          >I guess, double-clicking on a shortcut to a web site does the same thing as
          >a CTRL-N. Ie., it does not launch a new session. Bummer.
          >
          >Thanks,
          >Greg
          >
          >
          >"Jim Cheshire (MS)" <jamesche@onlin e.microsoft.com > wrote in message
          >news:OFQmsOUVD HA.2000@cpmsftn gxa06.phx.gbl.. .[color=green]
          >> Hi Greg,
          >>
          >> I can reproduce this issue easily. I am looking into it for you.
          >>
          >> Jim Cheshire
          >> Developer Support
          >> ASP.NET
          >> jamesche@online .microsoft.com
          >>
          >> This post is provided as-is with no warranties and confers no rights.
          >>
          >> --------------------[color=darkred]
          >> >From: "Greg Burns" <greg_burns@hot mail.com>
          >> >References: <#TWEU8gUDHA.22 84@TK2MSFTNGP11 .phx.gbl>[/color]
          >> <oswAdEoUDHA.21 52@cpmsftngxa06 .phx.gbl>[color=darkred]
          >> >Subject: Re: forms authentication not authenticating
          >> >Date: Mon, 28 Jul 2003 10:20:37 -0400
          >> >Lines: 55
          >> >X-Priority: 3
          >> >X-MSMail-Priority: Normal
          >> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
          >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
          >> >Message-ID: <#E1jsNRVDHA.21 04@TK2MSFTNGP10 .phx.gbl>
          >> >Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
          >> >NNTP-Posting-Host: 146.145.213.7
          >> >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
          >> >Xref: cpmsftngxa06.ph x.gbl[/color][/color]
          >microsoft.publ ic.dotnet.frame work.aspnet:162 604[color=green][color=darkred]
          >> >X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
          >> >
          >> >I did some more testing.
          >> >
          >> >Try this to duplicate the problem:
          >> >
          >> >Open a site that uses forms authentication. In my test I am using the
          >> >IBuySpy portal.
          >> >
          >> >http://www.asp.net/IBS_Portal/DesktopDefault.aspx
          >> >
          >> >Create account and sign in (do not check the remember login box).[/color][/color]
          >Creating[color=green][color=darkred]
          >> >a shortcut on desktop (I think this is the important piece.) to the web
          >> >site.
          >> >
          >> >Close all browser windows.
          >> >
          >> >Open a new browser window to something (say www.yahoo.com)
          >> >
          >> >Leave that window open, double click on the shortcut to IBuySpy portal.
          >> >Sign-in again. Close browser, leaving Yahoo open in first browser.
          >> >Double-click shortcut to IBuySpy again. Notice, you are still logged[/color][/color][/color]
          in![color=blue][color=green][color=darkred]
          >> >Close window, repeat ad nauseam. :^)
          >> >
          >> >Thanks,
          >> >Greg
          >> >
          >> >
          >> >
          >> >"Tian Min Huang" <timhuang@onlin e.microsoft.com > wrote in message
          >> >news:oswAdEoUD HA.2152@cpmsftn gxa06.phx.gbl.. .
          >> >> Hi Greg,
          >> >>
          >> >> It is really strange since the browser has no relation to the asp.net[/color][/color]
          >web[color=green][color=darkred]
          >> >> application. Anyway, please check out your web.config file to see if[/color]
          >> there[color=darkred]
          >> >> is anything wrong.
          >> >>
          >> >> Also, I suggest you try the steps in this article to create a form[/color][/color]
          >based[color=green][color=darkred]
          >> >> authentication asp.net web app. Please test on this new web app to see[/color][/color]
          >if[color=green][color=darkred]
          >> >> you could repro the problem.
          >> >> "HOW TO: Implement Forms-Based Authentication in Your ASP.NET[/color][/color]
          >Application[color=green][color=darkred]
          >> >> by Using Visual Basic .NET"
          >> >> http://support.microsoft.com/?id=308157
          >> >>
          >> >> Regards,
          >> >>
          >> >> HuangTM
          >> >> Microsoft Online Partner Support
          >> >> MCSE/MCSD
          >> >>
          >> >> Get Secure! ¨C www.microsoft.com/security
          >> >> This posting is provided ¡°as is¡± with no warranties and confers no
          >> >rights.
          >> >>
          >> >>
          >> >
          >> >
          >> >[/color]
          >>[/color]
          >
          >
          >[/color]

          Comment

          Working...