surendra bansod
asked on
Session timeout does not working properly at asp.net mvc 4 C# . Why?
I had developed a web application by using asp.net mvc4 c#. It is working fine on local machine. but when i deployed it on server, session expires frequently within 2 to 3 minutes even if client is working on it. Code of web.config file is given below.
please help me in solving issue as soon as possible.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<connectionStrings>
<add name="PMSDBEntities" connectionString="metadata =res://*/P MS.csdl|re s://*/PMS. ssdl|res:/ /*/PMS.msl ;provider= System.Dat a.SqlClien t;provider connection string="data source=BHUSHAN-PC\Parate;i nitial catalog=PMSDB;integrated security=True;multipleacti veresultse ts=True;Ap p=EntityFr amework&qu ot;" providerName="System.Data. EntityClie nt" />
<!--Online Connection-->
<!--<add name="PMSDBEntities" connectionString="metadata =res://*/P MS.csdl|re s://*/PMS. ssdl|res:/ /*/PMS.msl ;provider= System.Dat a.SqlClien t;provider connection string="data source=208.91.198.174;init ial catalog=*****;User ID=******;Password=******; multipleac tiveresult sets=True; App=Entity Framework& quot;" providerName="System.Data. EntityClie nt" />-->
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="1.0.0.0"/>
<add key="ClientValidationEnabl ed" value="true"/>
<add key="UnobtrusiveJavaScript Enabled" value="true"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstr actions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35" />
<add assembly="System.Web.Helpe rs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35" />
<add assembly="System.Web.Routi ng, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35" />
<add assembly="System.Web.WebPa ges, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipP rovider" type="System.Web.Security. SqlMembers hipProvide r" connectionStringName="Appl icationSer vices"
enablePasswordRetrieval="f alse" enablePasswordReset="true" requiresQuestionAndAnswer= "false" requiresUniqueEmail="false "
maxInvalidPasswordAttempts ="5" minRequiredPasswordLength= "6" minRequiredNonalphanumeric Characters ="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProv ider" type="System.Web.Profile.S qlProfileP rovider" connectionStringName="Appl icationSer vices" applicationName="/" />
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvide r" type="System.Web.Security. SqlRolePro vider" connectionStringName="Appl icationSer vices" applicationName="/" />
<add name="AspNetWindowsTokenRo leProvider " type="System.Web.Security. WindowsTok enRoleProv ider" applicationName="/" />
</providers>
</roleManager>
<pages>
<namespaces>
<add namespace="System.Web.Help ers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc. Ajax" />
<add namespace="System.Web.Mvc. Html" />
<add namespace="System.Web.Rout ing" />
<add namespace="System.Web.WebP ages"/>
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConf iguration= "false"/>
<modules runAllManagedModulesForAll Requests=" true"/>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microso ft-com:asm .v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad 364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0. 0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
please help me in solving issue as soon as possible.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<connectionStrings>
<add name="PMSDBEntities" connectionString="metadata
<!--Online Connection-->
<!--<add name="PMSDBEntities" connectionString="metadata
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="1.0.0.0"/>
<add key="ClientValidationEnabl
<add key="UnobtrusiveJavaScript
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstr
<add assembly="System.Web.Helpe
<add assembly="System.Web.Routi
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3
<add assembly="System.Web.WebPa
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn"
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipP
enablePasswordRetrieval="f
maxInvalidPasswordAttempts
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProv
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvide
<add name="AspNetWindowsTokenRo
</providers>
</roleManager>
<pages>
<namespaces>
<add namespace="System.Web.Help
<add namespace="System.Web.Mvc"
<add namespace="System.Web.Mvc.
<add namespace="System.Web.Mvc.
<add namespace="System.Web.Rout
<add namespace="System.Web.WebP
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConf
<modules runAllManagedModulesForAll
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microso
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad
<bindingRedirect oldVersion="1.0.0.0-2.0.0.
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
Check this link
http://blogs.msdn.com/b/amb/archive/2012/07/31/easiest-way-to-generate-machinekey.aspx
Don't apply the machine key, just copy and paste it in your web.config.
Check this link
http://blogs.msdn.com/b/amb/archive/2012/07/31/easiest-way-to-generate-machinekey.aspx
Don't apply the machine key, just copy and paste it in your web.config.
ASKER
It was helpful to solve the problem
Follow this link
http://stackoverflow.com/questions/3995264/why-really-short-timeout-in-asp-net-mvc
hope it helps..!!!