在关闭自动登录的用户了asp.net网站

编程入门 行业动态 更新时间:2024-10-25 13:27:05
本文介绍了在关闭自动登录的用户了asp网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

最近,我继承了由多个的.aspx和的.ascx页,并成为相当新的网络开发和especailly asp一个asp网站。我在网站创建在登录一个cookie,如果页面超时的他们,而他们正在进入信息自动登录用户回。

I recently inherited an asp website made up of multiple .aspx and .ascx pages and being rather new to web development and especailly asp. I have the site create a cookie upon login to automatically log users back in if the page times out on them while they're entering information.

我需要的网站时,该网站已关闭自动注销用户。显然,使用每个页面上的me.close事件将不会工作,因为我们不希望它每次他们浏览到一个新的一页网站时登录的人了。

I need the site to automatically log users out when the site is closed. Obviously using the me.close event on each page won't work because we don't want it to log people out every time they navigate to a new page in the site.

我试过设置在IIS都和网站的文件超时来反而显得更长它不产生作用。

I've tried setting the timeouts in both IIS and in the files of the website to longer but it doesn't seem to have an effect.

有没有一种简单的方法,当他们离开现场,但不是当他们从网页浏览网页时自动注销用户。

Is there an easy way to automatically log users out when they leave the site but not when they navigate from page to page.

推荐答案

HTTP是一个无状态的协议,所以真的是没有简单的方法来做到这一点。

HTTP is a stateless protocol, so there really is no easy way to do this.

如果这将是您的服务的重要组成部分,你可以使用AJAX坪,每30秒钟,然后如果没有2分钟一个ping就可以登录他们出去。

If it's going to be an essential part of your service, you can use AJAX pings every 30 seconds, then if there isn't a ping for 2 minutes you can log them out.

这是我已经在我的网站的应用程序之一完成的,它似乎工作得很好。

This is what I've done on one of my sites apps and it seems to work quite well.

更多推荐

在关闭自动登录的用户了asp.net网站

本文发布于:2023-11-25 01:19:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627734.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自动登录   用户   网站   asp   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!