timeout i web.config
Jeg har overtaget følgende stump kode, der er placeret i en global.asax fil:Sub getTimeOut()
Dim xpathDoc As XPathDocument
Dim xmlNav As XPathNavigator
Dim xmlNI As XPathNodeIterator
Dim path As String = Server.MapPath("")
Dim value As String
Try
xpathDoc = New XPathDocument(path & "/Web.config")
xmlNav = xpathDoc.CreateNavigator()
xmlNI = xmlNav.Select("//configuration/system.web/sessionState")
While (xmlNI.MoveNext())
If xmlNI.Current.HasAttributes Then
value = xmlNI.Current.GetAttribute("timeout", "")
End If
End While
Application.Add("timeout", value)
Catch ex As Exception
'if any error occurs, set timeout to 20 which is .NET default
Application.Add("timeout", 20)
End Try
End Sub
Web.config:
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="20"/>
Sættes en Application session timeout ikke direkte i web.config filen som standard?
og hvis denne ikke overskrives vil den så ikke være betydende for hele projektet?