Session timeout not working

Discussion in 'ASP .Net' started by =?Utf-8?B?aG4=?=, Jan 28, 2005.

  1. I tried to set session timeout =1 minute as seen below in my Web.config but
    it didn't work. I also tried to set the timeout in IIS as well and still the
    application doesn't time out after 1 minute. Please show me how to set the
    timeout setting. Thanks.

    <sessionState
    mode="StateServer"
    stateConnectionString="tcpip=127.0.0.1:42424"
    sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
    cookieless="false"
    timeout="1"
    />
     
    =?Utf-8?B?aG4=?=, Jan 28, 2005
    #1
    1. Advertising

  2. how do you know the session didn't time out? what tests are you running to
    show that it didn't time out? If you put a break point in the session
    timeout event, does it hold?

    --
    Regards,
    Alvin Bruney

    [Shameless Author plug]
    The Microsoft Office Web Components Black Book with .NET
    Now Available @ www.lulu.com/owc
    ----------------------------------------------------------


    "hn" <> wrote in message
    news:...
    >I tried to set session timeout =1 minute as seen below in my Web.config but
    > it didn't work. I also tried to set the timeout in IIS as well and still
    > the
    > application doesn't time out after 1 minute. Please show me how to set the
    > timeout setting. Thanks.
    >
    > <sessionState
    > mode="StateServer"
    > stateConnectionString="tcpip=127.0.0.1:42424"
    > sqlConnectionString="data
    > source=127.0.0.1;Trusted_Connection=yes"
    > cookieless="false"
    > timeout="1"
    > />
     
    Alvin Bruney [MVP], Jan 29, 2005
    #2
    1. Advertising

  3. On my asp.net pages I use session for authentication. If session ends, the
    user should be logged out and redirected to some other page. Currently the
    user is only logged out after 20 minutes or so. when I set timeout=1, the
    user is still able to navigate the authenticated pages after 1 minute of
    being inactive.

    "Alvin Bruney [MVP]" wrote:

    > how do you know the session didn't time out? what tests are you running to
    > show that it didn't time out? If you put a break point in the session
    > timeout event, does it hold?
    >
    > --
    > Regards,
    > Alvin Bruney
    >
    > [Shameless Author plug]
    > The Microsoft Office Web Components Black Book with .NET
    > Now Available @ www.lulu.com/owc
    > ----------------------------------------------------------
    >
    >
    > "hn" <> wrote in message
    > news:...
    > >I tried to set session timeout =1 minute as seen below in my Web.config but
    > > it didn't work. I also tried to set the timeout in IIS as well and still
    > > the
    > > application doesn't time out after 1 minute. Please show me how to set the
    > > timeout setting. Thanks.
    > >
    > > <sessionState
    > > mode="StateServer"
    > > stateConnectionString="tcpip=127.0.0.1:42424"
    > > sqlConnectionString="data
    > > source=127.0.0.1;Trusted_Connection=yes"
    > > cookieless="false"
    > > timeout="1"
    > > />

    >
    >
    >
     
    =?Utf-8?B?aG4=?=, Jan 31, 2005
    #3
  4. You have a logic error. In each page load, you need to check session to find
    out if the user is still authenticated.
    Consider:
    if(Session["LOGIN"] == null)
    redirect to login page

    In your case, when the timeout occurs and you redirect, you are using a new
    session. But since you don't check if it is a new session, it appears that
    the user is using the old session. Makes sense?

    --
    Regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    The Microsoft Office Web Components Black Book with .NET
    Now Available @ http://tinyurl.com/27cok
    ----------------------------------------------------------


    "hn" <> wrote in message
    news:...
    > On my asp.net pages I use session for authentication. If session ends, the
    > user should be logged out and redirected to some other page. Currently the
    > user is only logged out after 20 minutes or so. when I set timeout=1, the
    > user is still able to navigate the authenticated pages after 1 minute of
    > being inactive.
    >
    > "Alvin Bruney [MVP]" wrote:
    >
    >> how do you know the session didn't time out? what tests are you running
    >> to
    >> show that it didn't time out? If you put a break point in the session
    >> timeout event, does it hold?
    >>
    >> --
    >> Regards,
    >> Alvin Bruney
    >>
    >> [Shameless Author plug]
    >> The Microsoft Office Web Components Black Book with .NET
    >> Now Available @ www.lulu.com/owc
    >> ----------------------------------------------------------
    >>
    >>
    >> "hn" <> wrote in message
    >> news:...
    >> >I tried to set session timeout =1 minute as seen below in my Web.config
    >> >but
    >> > it didn't work. I also tried to set the timeout in IIS as well and
    >> > still
    >> > the
    >> > application doesn't time out after 1 minute. Please show me how to set
    >> > the
    >> > timeout setting. Thanks.
    >> >
    >> > <sessionState
    >> > mode="StateServer"
    >> > stateConnectionString="tcpip=127.0.0.1:42424"
    >> > sqlConnectionString="data
    >> > source=127.0.0.1;Trusted_Connection=yes"
    >> > cookieless="false"
    >> > timeout="1"
    >> > />

    >>
    >>
    >>
     
    Alvin Bruney [MVP], Jan 31, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Do
    Replies:
    2
    Views:
    6,456
  2. bruce barker

    Re: ASPX Page Timeout - Session Timeout

    bruce barker, Jul 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    11,156
    ASP.Confused
    Jul 20, 2004
  3. =?Utf-8?B?Q3JhaWc=?=

    formsauthentication timeout & session timeout

    =?Utf-8?B?Q3JhaWc=?=, Aug 10, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,711
    =?Utf-8?B?RU5JWklO?= .enizin.net>
    Aug 10, 2005
  4. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,437
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  5. Mark Probert

    Timeout::timeout and Socket timeout

    Mark Probert, Oct 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    1,367
    Brian Candler
    Oct 6, 2004
Loading...

Share This Page