woodsrr 0 Newbie Poster

An application I developed has its session variables reset within 5 minutes. My session variables were timing out when I was connected to a asp state server so I switch session state mode to SQL with the hope that it would fix my problem. Now I'm getting a different error.

If I let my site sit idle for as little as 5 minutes and then click on a button I get: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. This is a dedicated box, no web farm or cluster.

If I continually refresh I don't get this issue which makes me think that the viewstate id is being lost after 5 minutes? I wouldn't think that would happen when useing SQL for session states.


I have the following code in my web.config file

<sessionState
           mode="InProc"
           stateConnectionString="tcpip=127.0.0.1:42424"
           stateNetworkTimeout="20"
           sqlConnectionString="data source=127.0.0.1;Integrated Security=SSPI"
           sqlCommandTimeout="30"
           customProvider=""
           cookieless="UseCookies"
           cookieName="ASP.NET_SessionId"
           timeout="45"
           allowCustomSqlDatabase="false"
           regenerateExpiredSessionId="true"
           partitionResolverType=""
           useHostingIdentity="true">
        <providers>
          <clear />
        </providers>
      </sessionState>

I normally timeout in about 5 minutes

I have setup a test site to show you the problem:
http://www.thisweb4me.com

All this page does is loop through all session variables and display them. I'm setting up two, one called "If You Can See This" and one called "Last Refresh" The Refresh button only reloads the page.
You will see that I have session variables. Wait 5 minutes and refresh the dumpsession.aspx page and you may loose your session variables.

First page only sets several session variables and redirects to the dumpsession.aspx page
dumpsession.aspx page only loops though the session object and displays each session name and value.

I’m at a total loss as what it may be and appreciate any suggestions or work arounds.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.