当用户在两个浏览器或同一浏览器的两个选项卡中打开网站时注销用户. [英] logging out users when user opens website in two browsers or two tabs of same browser.

查看:127
本文介绍了当用户在两个浏览器或同一浏览器的两个选项卡中打开网站时注销用户.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们在应用程序中实现了以下场景:

1.我们使用Windows身份验证.用户在tab1中打开我们的网站并执行一些操作,但是在不单击保存的情况下,他打开了一个新标签tab2并再次打开了相同的网站.

2.当用户在新标签页或浏览器中打开网站时,如果tab1中的用户会话处于活动状态,我需要警告用户他已经在其他浏览器中登录到应用程序并转到某些注销页面.但是,如果tab1中的用户会话超时,则他必须能够照常继续使用tab2中的网站,但是稍后,如果他尝试在tab1中进行任何操作,则应转到会话过期页面.

有任何想法吗?
如果有人实施了此操作,请帮帮我.
我想出了一种方法来做到这一点,但是对我来说,这似乎不是一个很好的编程方法:((..

在此先感谢
Harsha

Hi,

We have the implement the following scenario in our application:

1.We use windows authentication. User opens our website in tab1 and does some action but with out clicking on save he opens a new tab tab2 and opens the same website again.

2.When user opens website in new tab or browser, if the user session in tab1 is active i need to warn users that the he is already logged on to application in some other browser and go to some log out page. But if the user session in tab1 is timed out then he must be able to continue with the website in tab2 as usual, but later if he tries to do anything in tab1 he should go to session expired page.

Any ides any one?
If anyone implemented this please help me out.
I figured out a way to do this but that doesn''t look like good programming to me :(( .

Thanks in Advance
Harsha

推荐答案

您如何存储/跟踪用户会话与实际会话的关系?

@stackoverflow上有关于它的讨论: http ://stackoverflow.com/questions/2829228/way-around-asp-net-session-being-shared-across-multiple-tab-window [
How are you storing/keeping track of the user''s versus actual Sessions?

There is a discussion about it @ stackoverflow:http://stackoverflow.com/questions/2829228/way-around-asp-net-session-being-shared-across-multiple-tab-window[^]


Personally i like the tab-GUID approach, but there is a long discussion there that i wish not to plagiarize ;) .


这篇关于当用户在两个浏览器或同一浏览器的两个选项卡中打开网站时注销用户.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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