Hello all,
I am currently working on an ASP.NET v4.0 project using VB Script for the server-side code. I have a number of session variables that I am using across multiple pages. My problem is that although I have set the session timeout to be 20 minutes or longer (programmatically, in Web.Config, and IIS), the Session variables are being dumped after exactly 2 minutes.
Web.config contents:
Session_Start routine:Code:<authentication mode="Forms"> <forms loginUrl="~/Login.aspx" timeout="900"/> </authentication>
After exactly 2 minutes (120 seconds) from the last refresh, all the values retrieved using Session("<insert variable name here>") are blank. Here are a few screen caps to show the IIS settings.Code:Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) ' Fires when the session is started Session.Timeout = 1200 ' Setting to a very high number to ensure that whatever timeout value is set in IIS *should* stick Session("VariableNames") = VariableValues ' ... multiple values here End Sub
Additionally because of this problem, I have created a generic dummy handle page called KeepSessionAlive.ashx and the following javascript is called using setInterval(KeepSessionAlive, 10000); (every 10 seconds) and I have confirmed that it is working, but the Session variables are still being dumped.
Am I missing something? Why is it dropping my Session values? Any help or information would be greatly appreciated.Code:function KeepSessionAlive() { //alert('testing'); $.post("KeepSessionAlive.ashx", null, function () { $("#result").append("<p>Session is alive</p>"); }); }
Thanks,
John Bergman


Reply With Quote