1

我的 web.config 中有这个:

<sessionState timeout="70"/>

和:

<authentication mode="Forms">
  <forms loginUrl="~/Index" timeout="60" />
</authentication>

我也有这个:

Session.Timeout = 70;

所以,一个小时左右后,用户仍然登录,但会话为空,我的程序崩溃了。任何想法?

4

2 回答 2

1

You have to put a check if your session is null then redirect to login page.

于 2012-05-17T10:31:27.480 回答
0

Actually the code in the question is correct. However, everytime I rebuild my code, the session was lost. That was the problem.

于 2012-05-22T13:01:53.360 回答