在会话超时后无法注销。 [英] Cant able to logout after session time out.

查看:112
本文介绍了在会话超时后无法注销。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户不使用apllication直到20分钟,我想注销我的应用程序,所以就像下面一样,但是它没有工作..激活时间超时而不是重定向到登录页面。



I want to logout my application if user not use apllication till 20 mins, so itried like below but its not working..session going time out but not redirecting to login page.

<authentication mode="Forms">
      <forms defaultUrl="~/login.aspx" loginUrl="~/login.aspx" slidingExpiration="true" timeout="10"></forms>
    </authentication>

推荐答案

会话是服务器概念,而不是客户端:它到期后,与客户端的连接已被破坏,因此您的服务器代码无法再与客户端通信以更改正在查看的页面。



您将拥有用javascript或HTML来做。

见这里: http://stackoverflow.com/questions/709182/asp-net-implementing-auto-logout-functionality [ ^ ]
The Session is a Server concept, not a client: when it expires, the connection to the client has been broken, so your server code can no longer communicate with the client to change the page it is viewing.

You will have to do it in the javascript or HTML.
See here: http://stackoverflow.com/questions/709182/asp-net-implementing-auto-logout-functionality[^]


如果你想从客户端触发超时,你必须使用任何客户端脚本创建计时器请点击此处获取超时的示例代码。



一个小描述,解释了如何在此处找到表单身份验证
If you want to trigar time out from client side you have to create timer using any client scripts. Please click here to get sample code for timeout.

A small description which explains how form authentication works found here


这篇关于在会话超时后无法注销。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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