Saturday, January 29, 2011

Setting Session time-out

We can do the setting in in the Session_Start event in Global.ASAX file, web.config file or IIS.The default time-out is 20 min.

**In Web.Config**
Here the timeout "20" is in
minutes if u want u can change in to fit your requirement.

mode="InProc"
cookieless="false"
timeout="20"
/>

InProc --> Indicates that session state is stored within the same process as that the application is running.
cokieless = "false" --> Indicates that sessions without cookies should not be used. The default is false.

**Session_Start of Global.ASAX**

protected void Session_Start(Object sender, EventArgs e)
{
Session.Timeout = 20;
}

**In IIS**

Go to Inetmgr -> Default Web Site -> Properties -> Home Directory -> Configuration -> Options


Priority is as follows : 1. Code
2. Web.Config
3. IIS

Disabling SessionState

Disable Session State at the Application Level: - In Web.Config, locate the section, and set the mode value to Off.

Disable Session State at the Page Level :- At the top of the page, add EnableSessionState="false" in the @ Page directive

No comments:

Post a Comment

Ajax CalendarExtender displaying at wrong position in Chrome

< script type ="text/javascript" language ="javascript">     function onCalendarShown(sender, args)...