超时不在web.config的身份验证部分中工作 [英] Timeout not working in authentication section of web.config

查看:73
本文介绍了超时不在web.config的身份验证部分中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

超时无法在web.config中工作



i希望在超时1分钟时将最终用户重定向到Logout.aspx



但它不起作用....

这是我的代码..



< ; authentication mode =Forms>



< forms name =。ASPXAUTHloginUrl =〜/ Logout.aspx?login = 1timeout = 1defaultUrl =FollowUps_Default.aspxslidingExpiration =true>



< authentication>



提前谢谢

timeout not working in web.config

i want to redirect the end-user to "Logout.aspx" when time out by 1 minute

but it's not working....
here is my code..

<authentication mode="Forms">

<forms name=".ASPXAUTH" loginUrl="~/Logout.aspx?login=1" timeout="1" defaultUrl="FollowUps_Default.aspx" slidingExpiration="true" >

<authentication>

Thanks in advance

推荐答案

您想要在Session元素上设置超时,而不是在forms元素上设置超时。 http://msdn.microsoft.com/en-us/library/h6bb9cz9 (v = vs.85).aspx [ ^ ]



另请注意,由于网络已断开连接,因此用户在超时时不会自动路由。如果您希望在会话结束时自动向LogOut.aspx发送一些内容,则必须跟踪客户端的时间。这是不容易的。



当会话超时,如果用户然后尝试点击导致服务器之旅的任何内容,那么它们将被重定向到LogOut.aspx页面。但是,只有当用户尝试做一些会触及服务器的事情(回发。)
You want to set the timeout on your Session element, not on the forms element. http://msdn.microsoft.com/en-us/library/h6bb9cz9(v=vs.85).aspx[^]

Also note, this will not automatically route users when they timeout because the web is disconnected. If you want to automatically send some to LogOut.aspx when their session ends you have to keep track of the time on the client side. It's not easy.

When the session times out if the user then tries to click on anything that causes a trip to the server, then they will be redirected to the LogOut.aspx page. But only if the user tries to do something that will hit the server (postbacks.)


尝试此链接时,它可以帮助您在会话到期时转到另一个页面。



http://www.dotnetgallery.com/kb/resource9-how-to-do-auto-logout-and-redirect -to-login-page-when-session-expires-using.aspx [ ^ ]
try this link,it may help you to ridirect to another page when session expires.

http://www.dotnetgallery.com/kb/resource9-how-to-do-auto-logout-and-redirect-to-login-page-when-session-expires-using.aspx[^]


这篇关于超时不在web.config的身份验证部分中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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