会话在一段时间后过期并重定向到登录页面 [英] session expire after some time and redirect to login page

查看:65
本文介绍了会话在一段时间后过期并重定向到登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在google上搜索过,有很多例子。

我尝试了不同的方法在登录页面中实现会话但是没有得到预期的结果。



我只想简单登录,会话过期后1分钟后页面将自动重定向到登录页面并要求再次登录。



希望我能得到解决方案...

请尝试给出答案。

谢谢我已经在代码项目文章中管理了这个问题但是在ASP.NET MVC应用程序的情况下,所以对于你的情况应该是类似的。以下是链接: MVC基本站点:第2步 - 例外管理 [ ^ ]



你应该特别注意下一章:管理未处理的异常。


 <  配置 >  
< system.web >
< sessionState < span class =code-attribute> mode = InProc timeout = 60 >
< / sessionState >
< / system.web >
< / configuration >







超时是几分钟......


hi all,

I searched on google,have so many examples.
I tried different ways to implement session in login page but not getting the expecting result.

I just want simple login and after session expire supoose after 1 min the page will redirect automatically to login page and asking for sign in again.

hope i will get the solution...
pls try to give answer.
thanks in advance.

解决方案

I have manage the problem in a Code Project article but in the case of an ASP.NET MVC application, so for your case should be something similar. Here is the link: MVC Basic Site: Step 2 - Exceptions Management[^]

You should look especially on the next chapter: "Manage Unhandled Exceptions".


<configuration>
<system.web>
 <sessionState mode="InProc" timeout="60">
 </sessionState>
 </system.web>
</configuration>




timeout is in minutes...


这篇关于会话在一段时间后过期并重定向到登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆