PC Review


Reply
Thread Tools Rating: Thread Rating: 7 votes, 4.43 average.

Re: EnableSessionState = False?

 
 
Brian Cryer
Guest
Posts: n/a
 
      30th Aug 2010
"Ele" <(E-Mail Removed)> wrote in message
news:4c74d634$0$19000$(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
enableSessionState error Adrian Microsoft ASP .NET 0 8th Jan 2004 08:08 PM
enableSessionState - still struggling Martin Microsoft ASP .NET 6 29th Dec 2003 04:30 PM
Session state can only be used when EnableSessionState is set to true... error John Baughman Microsoft ASP .NET 6 24th Dec 2003 07:50 AM
RE: Can't use Session in ASP.NET - enableSessionState error Jim Cheshire [MSFT] Microsoft ASP .NET 3 4th Aug 2003 05:27 PM
enablesessionstate Page directive is needed to use the Session object Marco Gerlach Microsoft ASP .NET 2 18th Jul 2003 11:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:19 PM.