Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Namespace HTML 5 local storage keys

I'm using the HTML 5 local storage API to store a user's access token. The requests then appends this token to access my server side API. I'm wondering if I need to namespace the keys I use. Does the browser take care of this or do I need to call the key something like 'my-awesome-app-token'? I noticed Twitter does this for some search params.

BTW, I know it's not secure to store the token there but security is not important here, the question is about namespacing keys.

Thanks!

like image 388
Cimm Avatar asked Nov 04 '10 20:11

Cimm


Video Answer


1 Answers

The browser takes care of it:

http://dev.w3.org/html5/webstorage/#dom-localstorage:

User agents must have a set of local storage areas, one for each origin.

like image 146
thejh Avatar answered Oct 21 '22 10:10

thejh