Session State Modes Available in ASP.NET
i. Global.asax, web.config or machine.config is changed.
ii. Bin directory of the application is modified.
iii. When virus scanning software touches some .config file or probes into bin directory.
iv. Various values of memoryLimit attribute inside <processModel> section.
i. Forms Authentication in web farm scenario.
ii. When we want view state to be available across the web farm.
Some Troubleshooting tips on session problems
<html>
<head>
<script language="javascript">
function CheckCookies()
{
//Create a Test cookie.
var testcookie = 'jscookietest=valid';
// Add this cookie in the cookie in the cookies collection of the document object.
document.cookie = testcookie;
if (document.cookie.indexOf(testcookie) == -1)
// If cookies is not created it means that cookies are not supported. So just redirect user to HTML/ASPX Page
// stating that cookies are enabled.
window.location.href = "Any HTML Page";
return false;
}
// It means cookies are enabled.
return true;
</script>
</head>
<body onLoad="javascript: return CheckCookies();">
Cookies are enabled.
</html>
<httpModule>
<add name="Session"
type="System.Web.SessionState.SessionStateModule"/>
………………
</httpModule>
Also note that sometime share point removes this module inside its web.config and as a result session state is not available.
NOTE: - SessinStateModule helps in managing session states. Its purpose is to generate or obtain session ID and for storing and retrieving session data for every request.
That's all for now on Session Mgmt. I will keep adding more and more findings as an when i encounter them in ASP.NET 1.0/1.1 as well as 2.0 !!!