限制多个选项卡中的多个会话 [英] Restrict multiple sessions in multiple tabs

查看:66
本文介绍了限制多个选项卡中的多个会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



我遇到了一个问题,我必须在多个会话的帮助下限制用户在多个标签页上工作。



如果用户登录到Web应用程序,那么如果用户打开一个新选项卡,其中包含先前打开的现有Web应用程序的相同URL,则会话不会没有注销,它会向我显示与会话登录相同的窗口。



我想阻止它像所有银行网站那样发生。每当我们登录我们的帐户并且如果我们打开一个已经打开银行URL的新标签,那么会话就会退出。



我们想知道他们是怎么做的。 />


谢谢



Varun Sareen

解决方案

这是一项有点繁琐的任务,因为会话存储在服务器端,服务器不会知道客户端正在进行的操作,因为浏览器窗口也是如此。你必须以适合所有现代的方式处理它您可以使用Cookie或会话ID(以及URL重写技术)。好了,请参阅以下链接,以便了解相同的内容。



ASP.NET IE选项卡和IE8之间共享的会话状态 [ ^ ]



避免在Internet Explorer的多个选项卡中共享相同的会话,以用于基于Java的Web应用程序。[Java] [ ^ ]



在每个浏览器标签中获取一个唯一的会话 [ ^ ]



如何在浏览器标签中区分会话? [ ^ ]



问候......:笑:

服务器没有标签甚至浏览器的概念,它不知道用户是否从同一个标签或不同的标签请求了网址。所有它必须坚持请求是cookie,如果您的标签共享cookie取决于您的浏览器如何工作。



所以基本上没有什么可以做到这一点

Dear Friends,

I am facing a problem where i have to restrict the user to work on multiple tabs in with the help of multiple sessions.

If a user login(s) into the web application then if the user opens a new tab with the same URL of the existing web application opened earlier then the session doesn't get logged out instead it shows me the same window with session login.

I want to prevent it to happen like all Bank sites does this. Whenever we login into our account and if we open a new tab with already opened bank URL then the session logs out.

How they do I want to know.

Thanks

Varun Sareen

解决方案

This is somewhat tedious task because session is stored at server side and server would not be aware of what is being done at client side as per as the browser window is concerned.Also you have to handle it in such a way that works for all modern browsers.You can make use of cookies or session ID(along with URL rewritting techniques).Well,refer to below link in order to have some idea regarding the same.

ASP.NET Session State shared between IE Tabs and IE8[^]

Avoid sharing of same session across multiple tabs in internet explorer for java based web application.[Java][^]

Get an unique session in each browser tab[^]

How to differ sessions in browser-tabs?[^]

Regards.. :laugh:


The server has no concept of tabs or even browsers, it has no idea if the user has requested the url from the same tab or a different one. All it has to persist across requests are cookies and if your tabs share cookies is down to how your browser works.

So basically there is nothing you can really do about this.


这篇关于限制多个选项卡中的多个会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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