Re: EnableSessionState = False?

"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.

Share This Page

Welcome to PC Review!

Hello and welcome to PC Review. We're a friendly computing community, bustling with knowledgeable members to help solve your tech questions.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask any tech support questions, or chat with the community and help others.
Sign up now!