Session timeout in IIS or web.config - precedence
-
Hi, I would like to know which would take precedence? If the timeout is set at 20 minutes in IIS and 30 minutes in web.config - at time would the application timeout? Thanks.
web.config as far as I know .. you could test it easily yourself if you want to be more sure .. in global.asax, write some code in session_start and session_end to save the current time in a log file .. For example, in global.asax:
void Session_Start(object sender, EventArgs e)
{
using (StreamWriter sw = File.AppendText(Server.MapPath("/session.log")))
{
sw.WriteLine(String.Format("Session started at {0}", DateTime.Now.ToString()));
}
}void Session_End(object sender, EventArgs e)
{
using (StreamWriter sw = File.AppendText(Server.MapPath("/session.log")))
{
sw.WriteLine(String.Format("Session ended at {0}", DateTime.Now.ToString()));
}
}and don't forget to add this at the top of the global.asax file (just below
<%@ Application Language= ...
):<%@ Import Namespace="System.IO" %>
Waleed Eissa .NET Software Developer in Sydney
modified on Wednesday, December 26, 2007 12:16:37 AM