Re: How do I change the session timeout?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.











.



Relevant Pages

  • RE: SessionId-Problem - New in VS2005 - Each browser child window is a new session
    ... As for the mutiple sessionId when open pages from the same browser window ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: SessionId-Problem - New in VS2005 - Each browser child window is a new session
    ... As for the mutiple sessionId when open pages from the same browser window ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: XML-RPC authentication
    ... What is 8 bit ASCII? ... XMLRPC should by the fact that it is XML support UTF8... ... And to authenitcation: a sessionid. ... sessiondID, deny request. ...
    (comp.lang.php)
  • Re: URGENT : ASP .NET cookieless session timeout
    ... Isn't the timeout used to timeout sessions when they have been ... I was thinking of setting the sessionId as a hidden form variable within ... Since ASP .NET creates a new session automatically if the ... Tecknick ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: sessionid changes
    ... A session id will not change before the timeout unless it has expired ... Or if you jump in and out of .asp pages ... To find the best Newsgroup for FrontPage support see: ... | i partialy solved the problem with a field that stores the sessionid and no ...
    (microsoft.public.frontpage.programming)