Forms-based authentication expires before timeout

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Forms-based authentication expires before timeout

    Hi,

    I'm having a problem with the forms-based authentication. The user is
    getting timed out before long before the timeout period has passed.
    The forms-based authentication timeout is set to 10 hours and session
    timeout to 2 hours.

    Has anyone experienced the same problems?

    I'm running framework 1.0.3705 on windows 2k server with IIS 5

    Any help is appreciated.

    Regards
    Anders Lybecker

    Anders Lybecker Guest

  2. Similar Questions and Discussions

    1. forms authentication cookie not timeout
      I customized the cookie generation in forms authentication so I can keep extra data in the cookie. but the problem now is that my forms...
    2. Forms authentication in WebServices and timeout
      Hi, I am having an issue with forms authentication and timeout. I created a simple web application and a web service based on the example in...
    3. Meaning Of Timeout In FOrms Authentication..????
      does Timeout deletes automatically the cookie in the clients browser i relied on forms cookie to authenticate the user and had set timeout to i...
    4. Forms-based Authentication
      HI I'm using Forms-based Authentication and trying out the example from the book: "ASP.NET Professional Secrets" after downloading the c# code...
    5. Forms Authentication timeout doesn't work
      I am trying to do some testing of my application with respect to timeouts (i.e. Session timeouts). I took the advice of somebody else in this...
  3. #2

    Default Forms-based authentication expires before timeout

    First of all, 10 hours for session timeout is going to
    crush your servers. That's an absolutely resource
    intensive approach to session timeouts. In addition, it
    also represents a security concern that someone could get
    up from their session and have it remain active as much
    as 10 hours later. I would think 2 hours each value
    would be more than adaquate, but in reality 20 minutes is
    a good approach for most sites. That means your session
    is renewed for 10 hours after each click.

    Even so, my gut instinct is that the problem you're
    having is related to how you're setting the timeout.
    First of all, know that the Administrator can control
    session timeout settings. Second, please forward along
    the part of your web.config and aspx files where you
    programatically set the limits. A common mistake is to
    use the server clock to set the session timeout client-
    side. Clocks are never in perfect concert.

    What I really think problem is, is that your forms based
    authentication ticket isn't being renewed. This is
    caused by FormsAuthentication.SlidingExpiration being
    false. Check to see at runtime if the value is false.
    If so your expiration is not being reset each request.

    Here's a related link:
    [url]http://www.asp.net/Forums/ShowPost.aspx?[/url]
    tabindex=1&PostID=90860
    >-----Original Message-----
    >Hi,
    >
    >I'm having a problem with the forms-based
    authentication. The user is
    >getting timed out before long before the timeout period
    has passed.
    >The forms-based authentication timeout is set to 10
    hours and session
    >timeout to 2 hours.
    >
    >Has anyone experienced the same problems?
    >
    >I'm running framework 1.0.3705 on windows 2k server with
    IIS 5
    >
    >Any help is appreciated.
    >
    >Regards
    >Anders Lybecker
    >
    >.
    >
    Keith Guest

  4. #3

    Default Re: Forms-based authentication expires before timeout

    On Sat, 31 Jan 2004 20:51:45 -0800, "Keith" <keith@keithadler.com>
    wrote:
    >First of all, 10 hours for session timeout is going to
    >crush your servers. That's an absolutely resource
    >intensive approach to session timeouts.
    I don't care, the we got plenty of resources. :-)
    The client is always right, and I have nothing to say in this matter.
    > In addition, it
    >also represents a security concern that someone could get
    >up from their session and have it remain active as much
    >as 10 hours later. I would think 2 hours each value
    >would be more than adaquate, but in reality 20 minutes is
    >a good approach for most sites. That means your session
    >is renewed for 10 hours after each click.
    Everything is running within as secure VPN network, so security is not
    that high a concern.
    >Even so, my gut instinct is that the problem you're
    >having is related to how you're setting the timeout.
    >First of all, know that the Administrator can control
    >session timeout settings. Second, please forward along
    >the part of your web.config and aspx files where you
    >programatically set the limits. A common mistake is to
    >use the server clock to set the session timeout client-
    >side. Clocks are never in perfect concert.
    >
    >What I really think problem is, is that your forms based
    >authentication ticket isn't being renewed. This is
    >caused by FormsAuthentication.SlidingExpiration being
    >false. Check to see at runtime if the value is false.
    >If so your expiration is not being reset each request.
    >
    >Here's a related link:
    >[url]http://www.asp.net/Forums/ShowPost.aspx?[/url]
    >tabindex=1&PostID=90860
    Here is part of the web.config:

    <authentication mode="Forms">
    <forms loginUrl="Login.aspx" timeout="600"/>
    </authentication>

    And the single line of code that sets the authentication token from
    the Login.aspx file:

    FormsAuthentication.RedirectFromLoginPage(strUserN ame, False)

    Am I missing something?

    Thanks
    Anders Lybecker

    >>-----Original Message-----
    >>Hi,
    >>
    >>I'm having a problem with the forms-based
    >authentication. The user is
    >>getting timed out before long before the timeout period
    >has passed.
    >>The forms-based authentication timeout is set to 10
    >hours and session
    >>timeout to 2 hours.
    >>
    >>Has anyone experienced the same problems?
    >>
    >>I'm running framework 1.0.3705 on windows 2k server with
    >IIS 5
    >>
    >>Any help is appreciated.
    >>
    >>Regards
    >>Anders Lybecker
    >>
    >>.
    >>
    Anders Lybecker Guest

  5. #4

    Default Re: Forms-based authentication expires before timeout

    If your are experiencing timeout problems, it might be the big gap between
    the session timeout and the Forms cookie timeout renewal. The latter, will
    renew it's value when more than half the specified time has elapsed (5 hs).
    If you have a session timeout of 2 hours, then the session will expire long
    before the cookie. So adjusting the forms timeout or the session timeout
    value should solve this problem. However, I agree with Keith comments about
    the suggested timeout values. Remember the "Defense in depth" security
    practice and despite you may have a VPN or plenty of processing resources,
    the majority of the attacks always comes from the inside.

    Regards,

    Hernan de Lahitte
    Lagash Systems S.A.
    [url]http://www.lagash.com[/url]



    "Anders Lybecker" <anders@(SPAMFILTER)lybecker.com> wrote in message
    news:3oks10thgkqgssvig4nohicgog5vgnmn8s@4ax.com...
    > On Sat, 31 Jan 2004 20:51:45 -0800, "Keith" <keith@keithadler.com>
    > wrote:
    >
    > >First of all, 10 hours for session timeout is going to
    > >crush your servers. That's an absolutely resource
    > >intensive approach to session timeouts.
    >
    > I don't care, the we got plenty of resources. :-)
    > The client is always right, and I have nothing to say in this matter.
    >
    > > In addition, it
    > >also represents a security concern that someone could get
    > >up from their session and have it remain active as much
    > >as 10 hours later. I would think 2 hours each value
    > >would be more than adaquate, but in reality 20 minutes is
    > >a good approach for most sites. That means your session
    > >is renewed for 10 hours after each click.
    >
    > Everything is running within as secure VPN network, so security is not
    > that high a concern.
    >
    > >Even so, my gut instinct is that the problem you're
    > >having is related to how you're setting the timeout.
    > >First of all, know that the Administrator can control
    > >session timeout settings. Second, please forward along
    > >the part of your web.config and aspx files where you
    > >programatically set the limits. A common mistake is to
    > >use the server clock to set the session timeout client-
    > >side. Clocks are never in perfect concert.
    > >
    > >What I really think problem is, is that your forms based
    > >authentication ticket isn't being renewed. This is
    > >caused by FormsAuthentication.SlidingExpiration being
    > >false. Check to see at runtime if the value is false.
    > >If so your expiration is not being reset each request.
    > >
    > >Here's a related link:
    > >[url]http://www.asp.net/Forums/ShowPost.aspx?[/url]
    > >tabindex=1&PostID=90860
    >
    > Here is part of the web.config:
    >
    > <authentication mode="Forms">
    > <forms loginUrl="Login.aspx" timeout="600"/>
    > </authentication>
    >
    > And the single line of code that sets the authentication token from
    > the Login.aspx file:
    >
    > FormsAuthentication.RedirectFromLoginPage(strUserN ame, False)
    >
    > Am I missing something?
    >
    > Thanks
    > Anders Lybecker
    >
    >
    > >>-----Original Message-----
    > >>Hi,
    > >>
    > >>I'm having a problem with the forms-based
    > >authentication. The user is
    > >>getting timed out before long before the timeout period
    > >has passed.
    > >>The forms-based authentication timeout is set to 10
    > >hours and session
    > >>timeout to 2 hours.
    > >>
    > >>Has anyone experienced the same problems?
    > >>
    > >>I'm running framework 1.0.3705 on windows 2k server with
    > >IIS 5
    > >>
    > >>Any help is appreciated.
    > >>
    > >>Regards
    > >>Anders Lybecker
    > >>
    > >>.
    > >>
    >

    Hernan de Lahitte Guest

  6. #5

    Default Re: Forms-based authentication expires before timeout

    On Mon, 2 Feb 2004 12:18:30 -0300, "Hernan de Lahitte"
    <hernan@lagash.com> wrote:
    >If your are experiencing timeout problems, it might be the big gap between
    >the session timeout and the Forms cookie timeout renewal.
    Why should the gap cause this problem?
    >The latter, will
    >renew it's value when more than half the specified time has elapsed (5 hs).
    >If you have a session timeout of 2 hours, then the session will expire long
    >before the cookie. So adjusting the forms timeout or the session timeout
    >value should solve this problem. However, I agree with Keith comments about
    >the suggested timeout values. Remember the "Defense in depth" security
    >practice and despite you may have a VPN or plenty of processing resources,
    >the majority of the attacks always comes from the inside.
    In a series of page requests after the user has logged in one of the
    suddenly fails and the login page is displayed. The timeframe is less
    than 10 minutes - a lot less than the timeout.

    Any suggestions?

    Regards
    Anders Lybecker

    >Regards,
    >
    >Hernan de Lahitte
    >Lagash Systems S.A.
    >[url]http://www.lagash.com[/url]
    >
    >
    >
    >"Anders Lybecker" <anders@(SPAMFILTER)lybecker.com> wrote in message
    >news:3oks10thgkqgssvig4nohicgog5vgnmn8s@4ax.com.. .
    >> On Sat, 31 Jan 2004 20:51:45 -0800, "Keith" <keith@keithadler.com>
    >> wrote:
    >>
    >> >First of all, 10 hours for session timeout is going to
    >> >crush your servers. That's an absolutely resource
    >> >intensive approach to session timeouts.
    >>
    >> I don't care, the we got plenty of resources. :-)
    >> The client is always right, and I have nothing to say in this matter.
    >>
    >> > In addition, it
    >> >also represents a security concern that someone could get
    >> >up from their session and have it remain active as much
    >> >as 10 hours later. I would think 2 hours each value
    >> >would be more than adaquate, but in reality 20 minutes is
    >> >a good approach for most sites. That means your session
    >> >is renewed for 10 hours after each click.
    >>
    >> Everything is running within as secure VPN network, so security is not
    >> that high a concern.
    >>
    >> >Even so, my gut instinct is that the problem you're
    >> >having is related to how you're setting the timeout.
    >> >First of all, know that the Administrator can control
    >> >session timeout settings. Second, please forward along
    >> >the part of your web.config and aspx files where you
    >> >programatically set the limits. A common mistake is to
    >> >use the server clock to set the session timeout client-
    >> >side. Clocks are never in perfect concert.
    >> >
    >> >What I really think problem is, is that your forms based
    >> >authentication ticket isn't being renewed. This is
    >> >caused by FormsAuthentication.SlidingExpiration being
    >> >false. Check to see at runtime if the value is false.
    >> >If so your expiration is not being reset each request.
    >> >
    >> >Here's a related link:
    >> >[url]http://www.asp.net/Forums/ShowPost.aspx?[/url]
    >> >tabindex=1&PostID=90860
    >>
    >> Here is part of the web.config:
    >>
    >> <authentication mode="Forms">
    >> <forms loginUrl="Login.aspx" timeout="600"/>
    >> </authentication>
    >>
    >> And the single line of code that sets the authentication token from
    >> the Login.aspx file:
    >>
    >> FormsAuthentication.RedirectFromLoginPage(strUserN ame, False)
    >>
    >> Am I missing something?
    >>
    >> Thanks
    >> Anders Lybecker
    >>
    >>
    >> >>-----Original Message-----
    >> >>Hi,
    >> >>
    >> >>I'm having a problem with the forms-based
    >> >authentication. The user is
    >> >>getting timed out before long before the timeout period
    >> >has passed.
    >> >>The forms-based authentication timeout is set to 10
    >> >hours and session
    >> >>timeout to 2 hours.
    >> >>
    >> >>Has anyone experienced the same problems?
    >> >>
    >> >>I'm running framework 1.0.3705 on windows 2k server with
    >> >IIS 5
    >> >>
    >> >>Any help is appreciated.
    >> >>
    >> >>Regards
    >> >>Anders Lybecker
    >> >>
    >> >>.
    >> >>
    >>
    >
    Anders Lybecker Guest

  7. #6

    Default Re: Forms-based authentication expires before timeout

    Check the page sequence that makes the login page to load.
    Are all the pages in this seq. in the same application/forms auth scope ?
    Your authz config is something like this?

    <authorization>
    <deny users = "?" />
    <allow users= "*" />
    </authorization>


    --
    Hernan de Lahitte
    Lagash Systems S.A.
    [url]http://www.lagash.com[/url]



    "Anders Lybecker" <anders@(SPAMFILTER)lybecker.com> wrote in message
    news:7ic12011kkin7m7cvnntpofffb9fuf7en7@4ax.com...
    > On Mon, 2 Feb 2004 12:18:30 -0300, "Hernan de Lahitte"
    > <hernan@lagash.com> wrote:
    >
    > >If your are experiencing timeout problems, it might be the big gap
    between
    > >the session timeout and the Forms cookie timeout renewal.
    >
    > Why should the gap cause this problem?
    >
    > >The latter, will
    > >renew it's value when more than half the specified time has elapsed (5
    hs).
    > >If you have a session timeout of 2 hours, then the session will expire
    long
    > >before the cookie. So adjusting the forms timeout or the session timeout
    > >value should solve this problem. However, I agree with Keith comments
    about
    > >the suggested timeout values. Remember the "Defense in depth" security
    > >practice and despite you may have a VPN or plenty of processing
    resources,
    > >the majority of the attacks always comes from the inside.
    >
    > In a series of page requests after the user has logged in one of the
    > suddenly fails and the login page is displayed. The timeframe is less
    > than 10 minutes - a lot less than the timeout.
    >
    > Any suggestions?
    >
    > Regards
    > Anders Lybecker
    >
    >
    > >Regards,
    > >
    > >Hernan de Lahitte
    > >Lagash Systems S.A.
    > >[url]http://www.lagash.com[/url]
    > >
    > >
    > >
    > >"Anders Lybecker" <anders@(SPAMFILTER)lybecker.com> wrote in message
    > >news:3oks10thgkqgssvig4nohicgog5vgnmn8s@4ax.com.. .
    > >> On Sat, 31 Jan 2004 20:51:45 -0800, "Keith" <keith@keithadler.com>
    > >> wrote:
    > >>
    > >> >First of all, 10 hours for session timeout is going to
    > >> >crush your servers. That's an absolutely resource
    > >> >intensive approach to session timeouts.
    > >>
    > >> I don't care, the we got plenty of resources. :-)
    > >> The client is always right, and I have nothing to say in this matter.
    > >>
    > >> > In addition, it
    > >> >also represents a security concern that someone could get
    > >> >up from their session and have it remain active as much
    > >> >as 10 hours later. I would think 2 hours each value
    > >> >would be more than adaquate, but in reality 20 minutes is
    > >> >a good approach for most sites. That means your session
    > >> >is renewed for 10 hours after each click.
    > >>
    > >> Everything is running within as secure VPN network, so security is not
    > >> that high a concern.
    > >>
    > >> >Even so, my gut instinct is that the problem you're
    > >> >having is related to how you're setting the timeout.
    > >> >First of all, know that the Administrator can control
    > >> >session timeout settings. Second, please forward along
    > >> >the part of your web.config and aspx files where you
    > >> >programatically set the limits. A common mistake is to
    > >> >use the server clock to set the session timeout client-
    > >> >side. Clocks are never in perfect concert.
    > >> >
    > >> >What I really think problem is, is that your forms based
    > >> >authentication ticket isn't being renewed. This is
    > >> >caused by FormsAuthentication.SlidingExpiration being
    > >> >false. Check to see at runtime if the value is false.
    > >> >If so your expiration is not being reset each request.
    > >> >
    > >> >Here's a related link:
    > >> >[url]http://www.asp.net/Forums/ShowPost.aspx?[/url]
    > >> >tabindex=1&PostID=90860
    > >>
    > >> Here is part of the web.config:
    > >>
    > >> <authentication mode="Forms">
    > >> <forms loginUrl="Login.aspx" timeout="600"/>
    > >> </authentication>
    > >>
    > >> And the single line of code that sets the authentication token from
    > >> the Login.aspx file:
    > >>
    > >> FormsAuthentication.RedirectFromLoginPage(strUserN ame, False)
    > >>
    > >> Am I missing something?
    > >>
    > >> Thanks
    > >> Anders Lybecker
    > >>
    > >>
    > >> >>-----Original Message-----
    > >> >>Hi,
    > >> >>
    > >> >>I'm having a problem with the forms-based
    > >> >authentication. The user is
    > >> >>getting timed out before long before the timeout period
    > >> >has passed.
    > >> >>The forms-based authentication timeout is set to 10
    > >> >hours and session
    > >> >>timeout to 2 hours.
    > >> >>
    > >> >>Has anyone experienced the same problems?
    > >> >>
    > >> >>I'm running framework 1.0.3705 on windows 2k server with
    > >> >IIS 5
    > >> >>
    > >> >>Any help is appreciated.
    > >> >>
    > >> >>Regards
    > >> >>Anders Lybecker
    > >> >>
    > >> >>.
    > >> >>
    > >>
    > >
    >

    Hernan de Lahitte Guest

  8. #7

    Default Re: Forms-based authentication expires before timeout

    On Wed, 4 Feb 2004 09:48:37 -0300, "Hernan de Lahitte"
    <hernan@lagash.com> wrote:
    >Check the page sequence that makes the login page to load.
    >Are all the pages in this seq. in the same application/forms auth scope ?
    >Your authz config is something like this?
    >
    ><authorization>
    > <deny users = "?" />
    > <allow users= "*" />
    ></authorization>
    The web.config:

    <authorization>
    <deny users="?"/>
    </authorization>

    The <alloe users="*" /> is implicit.

    Regards
    Anders Lybecker

    Anders Lybecker Guest

  9. #8

    Default Re: Forms-based authentication expires before timeout

    I've had the same problem too. It seems to work correctly at times but then
    reverts to seemingly random timeouts.
    Never did find out why it doesn't work as planned. BTW I'm using Win2003 +
    ..NET 1.1. However on my XP 1.1 dev box it works fine 100% of the time.

    --
    Cheers

    Pete

    XBOX Live Leagues & Tournaments
    [url]http://www.xboxracing.net/[/url]
    "Anders Lybecker" <anders@(SPAMFILTER)lybecker.com> wrote in message
    news:g96i10h5jugepvrr16oo82fa4mblcqjc5h@4ax.com...
    > Hi,
    >
    > I'm having a problem with the forms-based authentication. The user is
    > getting timed out before long before the timeout period has passed.
    > The forms-based authentication timeout is set to 10 hours and session
    > timeout to 2 hours.
    >
    > Has anyone experienced the same problems?
    >
    > I'm running framework 1.0.3705 on windows 2k server with IIS 5
    >
    > Any help is appreciated.
    >
    > Regards
    > Anders Lybecker
    >

    Pete Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139