<sessionState attributes help needed.

  • Thread starter Thread starter jensen bredal
  • Start date Start date
J

jensen bredal

Hello,

i was not able to find any documentation about the largest value one can
assign the "timeout" attribute of the
<sessionState section in web.config.



any idea?



Many thanks



JB
 
Since the Session.Timeout property holds an Int32, I'd say the largest
value would be 2,147,483,647.

--s
 
Since the Session.Timeout property holds an Int32, I'd say the largest
value would be 2,147,483,647.

--s

Then why does 900000 cause the exception below?


Specified argument was out of the range of valid values. Parameter name:
slidingExpiration
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument
was out of the range of valid values. Parameter name: slidingExpiration

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of
valid values.
Parameter name: slidingExpiration]
System.Web.Caching.CacheEntry..ctor(String key, Object value,
CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler,
DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration,
CacheItemPriority priority, Boolean isPublic) +649
System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key,
Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration,
TimeSpan slidingExpiration, CacheItemPriority priority,
CacheItemRemovedCallback onRemoveCallback, Boolean replace) +91
System.Web.Caching.CacheInternal.UtcInsert(String key, Object value,
CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan
slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback
onRemoveCallback) +40
System.Web.SessionState.InProcStateClientManager.System.Web.SessionState.IStateClientManager.Set(String
id, SessionStateItem item, Boolean inStorage)
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
EventArgs eventArgs)
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +87





500000 does not.
 
What you're doing is unrelated to Session state. You're using the data Cache.
The max sliding expiration is one year.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Since the Session.Timeout property holds an Int32, I'd say the
largest value would be 2,147,483,647.

--s
Then why does 900000 cause the exception below?

Specified argument was out of the range of valid values. Parameter
name:
slidingExpiration
Description: An unhandled exception occurred during the execution of
the
current web request. Please review the stack trace for more
information
about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Specified
argument was out of the range of valid values. Parameter name:
slidingExpiration

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range
of
valid values.
Parameter name: slidingExpiration]
System.Web.Caching.CacheEntry..ctor(String key, Object value,
CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler,
DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration,
CacheItemPriority priority, Boolean isPublic) +649
System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String
key,
Object value, CacheDependency dependencies, DateTime
utcAbsoluteExpiration,
TimeSpan slidingExpiration, CacheItemPriority priority,
CacheItemRemovedCallback onRemoveCallback, Boolean replace) +91
System.Web.Caching.CacheInternal.UtcInsert(String key, Object
value,
CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan
slidingExpiration, CacheItemPriority priority,
CacheItemRemovedCallback
onRemoveCallback) +40

System.Web.SessionState.InProcStateClientManager.System.Web.SessionSta
te.IStateClientManager.Set(String
id, SessionStateItem item, Boolean inStorage)
System.Web.SessionState.SessionStateModule.OnReleaseState(Object
source,
EventArgs eventArgs)

System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutio
nStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean&
completedSynchronously) +87
500000 does not.
 
What I wonder is why you would want to
set the timeout value at even 500,000.

You'll run out of RAM well before you reach
500,000 minutes, and your apps will recycle.

To want to have almost a year for a session
to timeout is silly, when the default is 20 minutes.



Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

Then why does 900000 cause the exception below?
 
Back
Top