1

I want to store a specific value for each browser window.
This value should stay the same after a reload.

An example:
I want to open 2 tabs of my page, both of them should be able to show the data of two different accounts. E.g. gmail has the ability to swap between 2 logged in pages. And even if you refresh the tab, the visible account stays the same.

At the moment I have only one possible solution in mind:

  1. Store the value in the url
  2. Make sure that every link on this page pass this value to the next page

But this way seems to be a little bit "dirty". It gets broken if I miss a single link.

Is there a way to use a hidden input instead, or some other js features?

Btw: I'm using aspx and IIS as web server.

TheBrain
  • 685
  • 6
  • 26

1 Answers1

0

I think you should use cookie, they stored in browser and stay after reload. Set cookie and get cookie with JavaScript

Community
  • 1
  • 1
  • And how can I detect from which browser window they come? As much as I know, all windows uses the same cookies (within a browser) – TheBrain Mar 17 '17 at 09:35