简体   繁体   English

记住没有会话的变量,这如何工作?

[英]Remembering variables without sessions, how does this work?

So I like to analyze websites and try to figure out how they work. 因此,我喜欢分析网站并尝试弄清楚它们的工作方式。

I came across this website. 我偶然发现了这个网站。 http://us.battle.net/d3/en/forum/ http://us.battle.net/d3/zh/forum/

They have a button that minimizes and maximizes divs. 它们具有最小化和最大化div的按钮。 AND it remembers if you left it minimized or maximized, regardless if you're logged in or not. 并且它会记住您是否将其最小化或最大化,无论您是否登录。 (it's browser specific, ie it only remembers based upon the brower you used.) (它是特定于浏览器的,即仅根据您使用的浏览器进行记忆。)

I see they're calling some javascript on this, but how is this done? 我看到他们在为此调用一些javascript,但是如何完成? Using cookies? 使用Cookie? I doubt it's being done with sessions since when I log in/out it doesn't affect it. 我怀疑它是在会话中完成的,因为当我登录/注销时它不会影响它。

Thanks. 谢谢。

They are using the cookie forumParentToggle . 他们正在使用cookie forumParentToggle This cookie is created the first time you expand or collapse a div. 该Cookie是在您首次扩展或折叠div时创建的。

For example, if you collapse the "Classes" div, the cookie is created with the value 3354995 . 例如,如果折叠“ Classes” div,则将使用值3354995创建cookie。

By deleting this cookie, the Classes div will be re-expanded when the page is refreshed. 通过删除此cookie,刷新页面时,Classs div将重新展开。 To the browser, it looks like you are visiting for the first time. 在浏览器中,您好像是第一次访问。

This cookie is referenced in the minified version of javascript they are utilizing here . 他们在此处使用的javascript精简版中引用了此cookie。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM