简体   繁体   中英

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/

They have a button that minimizes and maximizes divs. 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? Using cookies? 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 . This cookie is created the first time you expand or collapse a div.

For example, if you collapse the "Classes" div, the cookie is created with the value 3354995 .

By deleting this cookie, the Classes div will be re-expanded when the page is refreshed. 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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