I am having problems with the loss of user data during the passage of the application form. It appears that they are losing some of the session state through the application forms. (ASP.NET 4.0 WebForms Project, IIS 6.0)
The session is stored outside the process on the state server, so that it does not change the configuration, addomain utility, etc. AFAIK.
<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" timeout="20" />
I use forms authentication, sliding completion works correctly, as you can see from the log below - you can see that the ticket expiration date is correct and expands as expireded.
<authentication mode="Forms"> <forms loginUrl="~/Login.aspx" /> </authentication>
I have included some user protocols to try and keep track of this. On every Session_Start fire in global.asax I register something, and I also register something every time someone loads an application form or clicks βNextβ to move between sections (in MultiView) when they go through application form.
Here are two examples when people lose session state. The journal begins with the date / time of the journal entry, then in some formulations. The second date / time in brackets (after the wording) is the date / time of the expiration of the cookie FormsAuthentication obtained from CType(ctx.User.Identity, FormsIdentity).Ticket.Expiration.ToString
Logging also logs the IP address and session ID of the user. I deleted them before inserting them here, I can confirm that the IP address and session ID are the same for all log entries.
Example 1:
** [10/26/2010 13:07] Session started [] **
[26/10/2010 13:11] Application form first Page_Load [10/26/2010 13:31:19]
[26/10/2010 13:13] App form next clicked, current index is 1 (vwSection1) [10/26/2010 13:31:19]
[26/10/2010 13:14] App form next clicked, current index is 2 (vwSection2) [10/26/2010 13:31:19]
[26/10/2010 13:15] App form next clicked, current index is 3 (vwSection3) [10/26/2010 13:31:19]
[26/10/2010 13:20] App form next clicked, current index is 5 (vwSection4) [10/26/2010 13:31:19]
[26/10/2010 13:20] App form next clicked, current index is 6 (vwSection5) [10/26/2010 13:31:19]
[26/10/2010 13:20] App form next clicked, current index is 7 (vwMonitoring) [10/26/2010 13:31:19]
[26/10/2010 13:21] App form next clicked, current index is 8 (vwInformation) [10/26/2010 13:31:19]
[26/10/2010 13:22] Application form first Page_Load [10/26/2010 13:41:22]
[26/10/2010 13:25] App form next clicked, current index is 1 (vwSection1) [10/26/2010 13:41:22]
[26/10/2010 13:26] App form next clicked, current index is 2 (vwSection2) [10/26/2010 13:41:22]
[26/10/2010 13:26] App form next clicked, current index is 3 (vwSection3) [10/26/2010 13:41:22]
[26/10/2010 13:28] App form next clicked, current index is 5 (vwSection4) [10/26/2010 13:41:22]
[26/10/2010 13:28] App form next clicked, current index is 6 (vwSection5) [10/26/2010 13:41:22]
[26/10/2010 13:28] App form next clicked, current index is 7 (vwMonitoring) [10/26/2010 13:41:22]
[26/10/2010 13:28] App form next clicked, current index is 8 (vwInformation) [10/26/2010 13:41:22]
** [10/26/2010 13:28] Session started [10/26/2010 1:41:22 PM] **
[26/10/2010 13:31] Application form first Page_Load [10/26/2010 13:51:24]
[26/10/2010 13:31] App form next clicked, current index is 1 (vwSection1) [10/26/2010 13:51:24]
[26/10/2010 13:32] App form next clicked, current index is 2 (vwSection2) [10/26/2010 13:51:24]
[26/10/2010 13:32] App form next clicked, current index is 3 (vwSection3) [10/26/2010 13:51:24]
[26/10/2010 13:32] App form next clicked, current index is 5 (vwSection4) [10/26/2010 13:51:24]
[26/10/2010 13:32] App form next clicked, current index is 6 (vwSection5) [10/26/2010 13:51:24]
[26/10/2010 13:32] App form next clicked, current index is 7 (vwMonitoring) [10/26/2010 13:51:24]
[26/10/2010 13:32] App form next clicked, current index is 8 (vwInformation) [10/26/2010 13:51:24]
Example 2:
** [10/24/2010 17:44] Session started [] **
[24/10/2010 17:50] Application form first Page_Load [10/24/2010 18:10:13]
[24/10/2010 18:00] App form next clicked, current index is 1 (vwSection1) [10/24/2010 18:20:40]
** [10/24/2010 18:07] Session started [10/24/2010 18:20:40] **
[24/10/2010 18:08] App form next clicked, current index is 2 (vwSection2) [10/24/2010 18:20:40]
[24/10/2010 18:10] App form next clicked, current index is 2 (vwSection2) [10/24/2010 18:20:40]
[24/10/2010 18:10] App form next clicked, current index is 1 (vwSection1) [10/24/2010 18:30:42]
[24/10/2010 18:10] App form next clicked, current index is 1 (vwSection1) [10/24/2010 18:30:52]
[24/10/2010 18:10] App form next clicked, current index is 1 (vwSection1) [10/24/2010 18:30:58]
[24/10/2010 18:12] Application form first Page_Load [10/24/2010 18:31:35]
[24/10/2010 18:12] App form next clicked, current index is 1 (vwSection1) [10/24/2010 18:31:35]
[24/10/2010 18:13] App form next clicked, current index is 2 (vwSection2) [10/24/2010 18:31:35]
[24/10/2010 18:13] App form next clicked, current index is 2 (vwSection2) [10/24/2010 18:31:35]
[24/10/2010 18:16] App form next clicked, current index is 3 (vwSection3) [10/24/2010 18:31:35]
[24/10/2010 18:16] App form next clicked, current index is 5 (vwSection4) [10/24/2010 18:31:35]
[24/10/2010 18:17] App form next clicked, current index is 6 (vwSection5) [10/24/2010 18:31:35]
[24/10/2010 18:18] App form next clicked, current index is 7 (vwMonitoring) [10/24/2010 18:31:35]
[24/10/2010 18:18] App form next clicked, current index is 8 (vwInformation) [10/24/2010 18:31:35]
In the first example, you can see that the session initially started at 13:07, but also started at 13:28.
In the second example, you can see that the session initially started at 17:44 and was restarted at 18:07.
I understand that this time is 20 minutes after the start of the session. But the session was not inactive. You can see that this was not idle due to the rest of the magazine. Clicking βNextβ in the application form gets something from the session state
Dim m As Member = StateManager.CurrentMember
then gets / sets the properties "m".
So, for me it looks, even if the user is not idle and have access to their session variables that they still lose their sessions exactly 20 minutes after they start. Please note that on my base page (where all pages are inherited, the base page inherits System.Web.UI.Page), I started writing the current millisecond to the session state, so I constantly record the session.
The user loses his session state because StateManager.CurrentMember (which is simply HttpContext.Current.Session("CurrentMember") ) returns null. This then gives an unhandled exception when I try to bind it to the Data Context data infrastructure - so users see my general error handling page.
Any ideas appreciated.