Connecting Tech Pros Worldwide Forums | Help | Site Map

Cannot Extent Session Timeout Without Cookieless Session

Newbie
 
Join Date: Sep 2006
Posts: 22
#1: Nov 6 '08
Hi all,

I'm having a problem with extending Session Timeouts... hopin someone can help..

This is the line under my <system.web> tag in my web.config:
Expand|Select|Wrap|Line Numbers
  1. <sessionState mode="InProc" timeout="45" cookieless="AutoDetect"></sessionState>
The line above does not extend my session. However, if I set cookieless="true", it seems to work just fine.

I don't want the sessionID in my client's address bar and I've looked throughout my code to ensure that the session is not being set elsewhere.

I should also add that the sessionState tag above will work if I put the value below the .NET default (which I believe the 20min).

Any thoughts?

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: Nov 6 '08

re: Cannot Extent Session Timeout Without Cookieless Session


When you set the timeout to be 45 in your web.config, what does it claim the timeout it when you go to the aspNET config?
Newbie
 
Join Date: Sep 2006
Posts: 22
#3: Nov 6 '08

re: Cannot Extent Session Timeout Without Cookieless Session


I'm a little unclear what exactly you mean by my ASPNet Config. Are you referring to the server/application configuration?

I looked in the Aspnet.config in my Framework directory and it contains this:
Expand|Select|Wrap|Line Numbers
  1.  <?xml version="1.0" encoding="UTF-8" ?>
  2. <configuration>
  3.     <runtime>
  4.         <legacyUnhandledExceptionPolicy enabled="false" />
  5.         <legacyImpersonationPolicy enabled="true"/>
  6.         <alwaysFlowImpersonationPolicy enabled="false"/>
  7.         <SymbolReadingPolicy enabled="1" />
  8.     </runtime>
  9. </configuration>
  10.  
I ran a trace on my page and I found this in the Headers Collection:
Expand|Select|Wrap|Line Numbers
  1. Cookie  -  hidefield=; ASP.NET_SessionId=xs1tth551ae1sai4rkjxetbr
There was no reference to any timeout values anywhere in my trace.
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#4: Nov 6 '08

re: Cannot Extent Session Timeout Without Cookieless Session


When you go to the IIS configuration (under admin tools)
And select the exact web(whatever) that you want to look at, for my example "testDB" is the one I look at.
I go to properties of it, select the ASPNET tab (which will tell you which version of ASPNET the website is configured for) and chose to "edit configuration"
A new window pops up with a number of tabs, "state management" has the session stuff.
This tab *SHOULD* reflect what is contained in your web.config, assuming everything is correct.
Newbie
 
Join Date: Sep 2006
Posts: 22
#5: Nov 10 '08

re: Cannot Extent Session Timeout Without Cookieless Session


Hi there,

That tab, on both my local machine's IIS and the dev server's IIS, read the same as the values in my web.config. However, the dev server seems to be ignoring these values and returning to the default 20...
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#6: Nov 10 '08

re: Cannot Extent Session Timeout Without Cookieless Session


That is only 20mins of not activity.
If it works on the real server, does it matter on the dev server?

You do know that every recompile/publish/etc of the website will wipe out the Session state right?
Reply