【发布时间】:2011-05-26 02:22:49
【问题描述】:
我有一个使用表单身份验证设置为 45 分钟超时的 asp.net 4.0 应用程序。当会话过期时,我想将用户重定向到超时页面。谁能告诉我该怎么做?我正在运行 .net 4.0。
web.config 有:
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="~/Login.aspx"
defaultUrl="~/Default.aspx" protection="All" timeout="45"
requireSSL="false">
</forms>
</authentication>
Global.asax.cs 文件有:
void Session_End(object sender, EventArgs e)
{
Response.Redirect("~/Timeout.aspx");
}
【问题讨论】:
标签: c# asp.net forms-authentication session-timeout