title: Local storage variable scope per tab in Google Chrome extensions
body: <p>I wanted to store variables per tab scope. This same question was raised already and the suggestion was to use localStorage. But how to use localStorage to save associative arrays?</p>
  <p>For example: A user is logging in a site. I want to create a variable to refer to that user. This way the user will open many tabs and he will log in to many sites. So I need to maintain the domain name and the user reference in localStorage, so if I use the username as a unique field then I can maintain an association with reference to the username, and finally I will need to store this information in the database.</p>
  <p>So, how to maintain a data structure in a Google Chrome extension? The above is just an example, but it could be any case where we need the same variable name in various tabs with different values.</p>
  <p>The documentation states to use JSON format. But still I want the users' suggestion on this.</p>
  <p>So any kind of response will he helpful, like answers, suggestions, references and comments.</p>