views:

244

answers:

1

Hello everyone,

In MSDN, it is said, "The timeout will not take effect while a server component is processing." -- what does this statement mean? Could anyone show a scenario it is referring to please?

http://msdn.microsoft.com/en-us/library/ms524831.aspx

A related question is, whether it is good code to judge that, if a session variable is "" (Empty String), then I treat session as expired? Like this,

<%
    if session("timeToken") = "" then
    // logics deal with session expire?
%>

thanks in advance, George

+1  A: 

I guess, Session_End (global.asa) could be the place where you can check for Session end/expiry.

Also, the MSDN sentence could mean the following.
If you are using a COM component inside your ASP page which takes long time before returning, the session timeout will not take effect till the call returns back to the next statement.

e.g. in your ASP code, you are calling a COM component that makes a time-consuming database request - In this case the call is still executing inside the COM component and at database level & ASP script won't be able to terminate this call.

I think it will have to wait before it could raise a timeout.

This is purely my understanding. You can verify it by doing such a thing inside an ASP page & observe the behavior.

shahkalpesh
Do you mean Session_End event handler? I think it is not ASP.Net not ASP classic?
George2
http://www.w3schools.com/ASP/asp_globalasa.asp
shahkalpesh
Thanks! About my related question in original post, any ideas -- "A related question is, whether it is good code to judge that, if a session variable is "" (Empty String), then I treat session as expired?"
George2
shahkalpesh
Actually the reason why I need such tricky to check empty is, I need to implement such scenario -- when the session timeout, I will redirect user to the login page again. Any ideas how to implement this gracefully without checking string empty?
George2