会话未过期.SessionState无法正常运行。 [英] Session not expired .SessionState not works properly.
本文介绍了会话未过期.SessionState无法正常运行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开展一个项目。问题是会话未过期。我在Web.Config中设置了Session,但会话仍未过期。我把它设置为10分钟。这是我的web.config
I am working on a project. The problem is the session not expired . I have set the Session in Web.Config but still the session not expired . I have set it to 10 minutes . Here is my web.config
<sessionState timeout="10" mode="InProc"
cookieless="false"></sessionState>
这是我在Session_Start方法下的Global.asax文件中的设置
and this is my setting in Global.asax file under Session_Start method
Session.Timeout=10;
推荐答案
你有没有处理过什么在会话结束后完成?
通常在会话到期后,应该在页面上执行任何操作时将其移动到登录页面。请参阅此配置以按预期工作: -
Have you handled what to be done after the expiration of the session ?
Generally after session expired it should be moved to login page on performing any operation on page.See this configuration to work as expected :-
<system.web>
<sessionstate timeout="1" />
<authentication mode="Forms">
<forms loginurl="~/Login.aspx" defaulturl="~/Home.aspx" slidingexpiration="true" timeout="1"></forms>
</authentication>
<compilation debug="true" targetframework="4.5" />
<httpruntime targetframework="4.5" />
</system.web>
如果您尝试进行任何操作,页面将自动重定向到登录页面会议结束后n。
如果这对你有用,请告诉我。
The page will automatically be redirected to Login page if you will try to do any operation after session expiration.
Please let me know if this works for you.
这篇关于会话未过期.SessionState无法正常运行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文