Re: How do I change the session timeout?
- From: "Juan T. Llibre" <nomailreplies@xxxxxxxxxxx>
- Date: Fri, 30 Mar 2007 10:06:09 -0400
re:
!> Have you checked the sessionID to verify that a different
!> sessionID has been established?
Steven,
There is an issue with SessionID, Internet Explorer and Firefox which consists in that,
if all instances of IE/Firefox aren't closed before attempting to create a new session,
the SessionID will be recycled ( the same SessionID will continue to be used ).
Easy repro :
1. Create a Session start time variable in global.asax:
Sub Session_OnStart()
Session.Contents("SessionStartTime") = Now
End Sub
2. Create a test page, SessionID.aspx :
<%@ Page Language="VB" %>
<html>
<head>
</head>
<body>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Response.Write("Session ID : " & Session.SessionID)
Response.Write("<br />")
Response.Write(" Session start time : " & Session("SessionStartTime"))
End Sub
</script>
</body>
</html>
3. Set the session timeout in web.config to 1 minute :
<sessionState mode="InProc" cookieless="false" timeout="1" />
Now, close all instances of Internet Explorer/Firefox, except one and :
1. Run SessionID.aspx and note the Session ID and the time.
2. After 1 minute and 1 second, refresh the page.
The SessionID will be the same, but the Session start time will be different.
( The SessionID was recycled, but there is a new Session start time, so there's a new session )
3. Now, close Internet Explorer/Firefox and run the same page.
The SessionID will change.
This behavior must be taken into consideration when testing because,
if all browser windows aren't closed, the SessionID will be the same
....even though a new session exists.
I haven't tested other browsers, but suspect that, since IE
and Firefox exhibit the same behavior, the same will happen.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:wT6ilapcHHA.4568@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Dave,
As for ASP.NET SessionState, the timeout setting does be the "timeout"
attribute of the <sessionState> element:
#sessionState Element
http://msdn2.microsoft.com/en-us/library/h6bb9cz9.aspx
As for the session timeout behavior, how did you found that the session
hasn't been timeout. When a old session has been timeout, a new one will be
started. Have you checked the sessionID to verify that a different
sessionID has been established?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- References:
- RE: How do I change the session timeout?
- From: Steven Cheng[MSFT]
- RE: How do I change the session timeout?
- Prev by Date: Bulleted List
- Next by Date: Re: How do I change the session timeout?
- Previous by thread: RE: How do I change the session timeout?
- Next by thread: RE: How do I change the session timeout?
- Index(es):
Relevant Pages
|