Click here to Skip to main content
15,898,611 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have creating a website into that some forms are to much large so that filling that forms session will be expird so that filled form will be lost how can avoid this please help me?


Thanks in advance.

What I have tried:

web.config
<authentication mode="Forms">
<forms name="MyAuth" timeout="120" protection="All" loginUrl="~/Login.aspx" slidingExpiration="true" />


<sessionstate mode="InProc" cookieless="false" timeout="100">

page_load()
{
Response.AddHeader("Refresh", Convert.ToString((Session.Timeout * 60) - 60));
}
Posted
Updated 5-May-16 21:26pm

You can set session timeout in your config file :

HTML
<system.web>
 <sessionstate mode="InProc" cookieless="false" timeout="80" />
</system.web>


Or in codebehind you can set using below code :

C#
Session.Timeout = 80;
 
Share this answer
 
Add

XML
<sessionState timeout="540"/>


Also set the app pool idle timeout to required timelimit if using IIS 6.

The Timeout property cannot be set to a value greater than 525,600 minutes (1 year). The default value is 20 minutes.

Disadvantage: You will have performance issues if you have large number of users and with increase in session timeout, your inactive sessions will remain in Web server memory which may cause application pool to recycle, which would result in loosing all sessions for all users.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900