How to allow longer time before timeout error?
am 21.01.2008 16:53:03 von Andrew
Hello, friends,
Our have a .net 2003 website using c#.net.
We want to let our users to have longer timeout time, and we did in
Web.config:
slidingExpiration="true" timeout="120" />
hopefully this would allow 2 hours before timeout.
However, it turned out users did not get that long timeout, rather they
still got timeout error like before.
Any reasons and how to fix it? Thanks.
Re: How to allow longer time before timeout error?
am 21.01.2008 17:03:45 von Leon Mayne
"Andrew" wrote in message
news:86328FE3-520C-4ED8-A610-799099BF4534@microsoft.com...
> Hello, friends,
>
> Our have a .net 2003 website using c#.net.
>
> We want to let our users to have longer timeout time, and we did in
> Web.config:
>
>
>
> slidingExpiration="true" timeout="120" />
>
>
> hopefully this would allow 2 hours before timeout.
>
> However, it turned out users did not get that long timeout, rather they
> still got timeout error like before.
>
> Any reasons and how to fix it? Thanks.
The session may be timing out before the authentication token. Set the
session timeout as well:
(Check that properly, as you may have to specify other settings)
Re: How to allow longer time before timeout error?
am 21.01.2008 17:15:43 von Leon Mayne
"Leon Mayne" wrote in message
news:FF7AB0FB-AF77-41AD-A63A-2BFE78688F53@microsoft.com...
> "Andrew" wrote in message
> news:86328FE3-520C-4ED8-A610-799099BF4534@microsoft.com...
>> Hello, friends,
>>
>> Our have a .net 2003 website using c#.net.
>>
>> We want to let our users to have longer timeout time, and we did in
>> Web.config:
>>
>>
>>
>> slidingExpiration="true" timeout="120" />
>>
>>
>> hopefully this would allow 2 hours before timeout.
>>
>> However, it turned out users did not get that long timeout, rather they
>> still got timeout error like before.
>>
>> Any reasons and how to fix it? Thanks.
>
> The session may be timing out before the authentication token. Set the
> session timeout as well:
>
> (Check that properly, as you may have to specify other settings)
P.S. You'll probably still get problems, as the session will often timeout
even though the authentication token is still valid. To fix this you need to
add some code in the Session_Start function in your Global.asax which will
check if the user is authenticated when a new session is starting, and if so
create all the user's session details again, e.g.
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Check to see if the user is already authenticated
If User.Identity.IsAuthenticated = True Then
' The session has expired before the forms authentication did
' Create session variables again for the user
Session("CurrentUser") = New
Person(CInt(Request.Cookies("UserId").Value))
End If
End Sub
If you do this then you don't have to modify your session timeout.