Re: EnableSessionState = False?

Discussion in 'Microsoft ASP .NET' started by Brian Cryer, Aug 30, 2010.

  1. Brian Cryer

    Brian Cryer Guest

    "Ele" <> wrote in message
    news:4c74d634$0$19000$...
    > Hello,
    >
    > I have an ASP.NET (C#) website. The session length is set to 20 minutes.
    >
    > In this website there is an .aspx page (in an IFRAME) that gets
    > automatically reloaded (using a javascript timer) every 5 minutes.
    > However, I noted that using this approach the session never expires, even
    > when the user is away from his computer (because the IFRAME page always
    > refreshes the session). Instead, I need that the session expires after 20
    > minutes.
    >
    > So I started looking at creating a page that does not update the Session
    > "timer" and found I had to use "EnableSessionState = False" in the @page
    > directtive of the .aspx page that gets reloaded every 5 minutes. However,
    > it does not seem to work, because the session does not expire after 20
    > minutes.


    Is there anything on your page (or being called by your page) which uses
    session information? I would GUESS that if you refer to session and the
    session isn't loaded that its loaded on demand at that point - but this is
    just a GUESS.

    > So the question is: how can I create a page that does not refresh the
    > session?
    > Thanks!


    A different approach, if you want the session to expire then does this mean
    that you want the page to stop updating after say 20 minutes? If so you
    could count the number of times the page has refreshed (possibly by adding a
    parameter to the refresh url), and simply stop refreshing once you've
    reached your desired limit. I know this isn't the same as using the session
    timeout, but it might do the trick.

    Hope this helps.
    --
    Brian Cryer
    http://www.cryer.co.uk/brian
     
    Brian Cryer, Aug 30, 2010
    #1
    1. Advertisements

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. Marco Gerlach
    Replies:
    2
    Views:
    344
    Marco Gerlach
    Jul 18, 2003
  2. Jim Cheshire [MSFT]

    RE: Can't use Session in ASP.NET - enableSessionState error

    Jim Cheshire [MSFT], Jul 30, 2003, in forum: Microsoft ASP .NET
    Replies:
    3
    Views:
    306
    Jim Cheshire [MSFT]
    Aug 4, 2003
  3. John Baughman
    Replies:
    6
    Views:
    925
    Natty Gur
    Dec 24, 2003
  4. Martin

    enableSessionState - still struggling

    Martin, Dec 26, 2003, in forum: Microsoft ASP .NET
    Replies:
    6
    Views:
    551
    Martin
    Dec 29, 2003
  5. user_me
    Replies:
    1
    Views:
    296
    Saravana
    Dec 15, 2004
Loading...

Share This Page