如何浏览器的多发片区分会议 [英] How to distinguish session between mutiple tabs of browsers

查看:90
本文介绍了如何浏览器的多发片区分会议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了一些方法来浏览器的多发片区分会话。首先是关于Cookiesless。二是使用JavaScript来处理当window.name打开新标签页。三是利用隐藏字段保存会话值。仍然有其他的方法来区分会话?

I got find some method to distinguish session between mutiple tabs of browsers. First is the about the Cookiesless. Second is using Javascript to handle the window.name when open new tabs. Third is using hidden field to keep the session value. Still got other method to distinguish the session?

推荐答案

这是很多网站做,包括我的DNS提供商等多家银行的,只是为了保持会话标识符的URL参数,而不是一个cookie,并有页面之间获得的每一个方式传递ID到下一个页面。

Something that many sites do, including my DNS provider and a number of banks, is just to keep the session identifier in a URL parameter instead of a cookie, and have every manner of getting between pages pass the id to the next page.

这导致了唯一幸存的,只要每个选项卡打开的会话,并且意味着每个标签都有一个不使用cookie唯一的会话。

This results in a session only surviving as long as each individual tab is open, and means that each tab has a unique session that does not use cookies.

在ASP.NET,使用每一页上都存在的隐藏字段,不断传递一个恒定的会话标识符是这样做的好,简单的方法。

In ASP.NET, using a hidden field that exists on every page to continuously pass a constant session identifier is a good and easy method of doing this.

您可以做的另一件事是哈希,如果你想使用浏览器的后退按钮或浏览器的历史出于安全原因阻止人们发生每一次航行的标识符。这是许多网路银行服务使用的方法。请注意,虽然非常安全,这种方法可能是令人沮丧的,为用户

Another thing you can do is to hash the identifier each time navigation occurs if you want to stop people using the browser back button or browser history for security reasons. This is the method many netbanking services use. Note that while very secure, this method can be frustrating for users.

这篇关于如何浏览器的多发片区分会议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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