请问这个网站知道我打开另一个选项卡? [英] How does this site know that I am opening another tab?

查看:241
本文介绍了请问这个网站知道我打开另一个选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我登录到一个网站,这是一个学习系统在我的大学,我发现,我无法打开一个新的标签与同一个网站开放。当我这样做,不知何故该网站是了解并显示如下消息?

When I login to a site, which is a "learning system" at my university, I have found that I cannot open a new tab with the same site open. When I do so, somehow the site is aware and displays the following message?

如何在地球上的网站知道什么标签我有我的电脑上打开?据我所知,前端code不应该有我的私人浏览器信息的任何访问。可能这个网站正在使用,以确定我有另一个选项卡已经打开访问哪些信息?

How on earth does the site know what tabs I have open on my computer? As far as I know, the front-end code shouldn't have any access to my private browser information. What accessible information could this site be using to determine that I have another tab open already?

我使用的是私人计算机访问该网站,并且被访问的网站是不是在本地网络上,它是通过互联网进行访问。因此,有可能会造成这种没有内部监控软件。我使用谷歌浏览器测试版24适用于Mac。

I am accessing the site using a private computer, and the site being accessed isn't on a local network, it is being accessed through the internet. Therefore there is no internal monitoring software that could be causing this. I am using Google Chrome 24 Beta for Mac.

推荐答案

一个做到这一点的方法是通过cookie和ID。首先,您登录到该网站并在那里有会话。这是使用cookie管理;当您访问一个页面的网站时,浏览器将发送通常含有某种ID的Cookie中。这样,服务器可以识别来自你的任何要求,是真正从你的。因此,在这种情况下,原来的标签,新标签都将发送相同的cookie。

One way to do this is via cookies and ids. Firstly, you are logged in to the site and have a session on there. This is managed using cookies; whenever you visit a page on the site, your browser will send a cookie which normally contains some kind of id. That way the server can identify any request coming from you, is really from you. So, in this case, both your original tab and your new tab will send the same cookie.

其次,它也可以添加其他,不同的ID(称之为页ID),任何链接或形成您在网站上提交。因此,一个页面上的表单可能包含ID 1234,以及任何链接也将包含该ID。您访问的每个新的页面可能包含一个新的ID。因此,在任何时候,该网站知道从你的浏览器下一个请求(由饼干标识)也应该包含这个其他标识。如果你在一个正常的方式在工地附近导航,点击链接,提交表单,这将是真实的,一切都会好的。

Secondly, it can also add another, different id (call it the page id), to any link or form you submit on the site. So a form on a page might contain the id 1234, and any links will also contain that id. Each new page you visit might contain a new id. So at any point, the site knows that next request from your browser (identified by the cookies) should also contain this other id. If you navigate around the site in a normal way, clicking on links, submitting forms, this will be true and all will be good.

情况下,当你的下一个请求将不会提交预期,第二个ID是:

Cases when your next request would NOT submit the expected, second id are:


  1. 您点击后退按钮(你会被发送旧的页面ID)

  2. 您打开一个新标签(这取决于浏览器,但如果它打开
    同一页面中,您已经在原来的标签,它会发送当前页
    ID,而不是下一个页面的id,该服务器期望)

无论哪种方式,你送一个页面ID的请求,服务器不指望它可以使一个最好的猜测,你做了什么。

Either way, you send a request with a page id the server doesn't expect and it can make a best guess as to what you did.

这篇关于请问这个网站知道我打开另一个选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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