The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Javascript localStorage (persistent cookies)
Christian J
post Feb 15 2012, 04:55 PM
Post #1


.
********

Group: WDG Moderators
Posts: 9,648
Joined: 10-August 06
Member No.: 7



The Javascript/DOM localStorage lets newer browsers store up to 5MB of data (per domain) on the HD. This seems very useful for developers, but few web users seem to know or care about the security/privacy implications. W3C itself points out the following vulnerability:

"7.2 Cross-directory attacks

Different authors sharing one host name, for example users hosting content on geocities.com, all share one local storage object. There is no feature to restrict the access by pathname. Authors on shared hosts are therefore recommended to avoid using these features, as it would be trivial for other authors to read the data and overwrite it."

Furthermore, current browsers have no dedicated controls for viewing or deleting the localStorage data (unlike cookies). Maybe you can get rid of it by deleting all user history/cache data, or by using browser extensions. Personally I feel more and more reluctant to use Javascript at all with inventions like this.

Some code examples and demos: http://www.javascriptkit.com/javatutors/domstorage.shtml (including workarounds for MSIE, which doesn't support localStorage yet).

Here's a bookmarklet/favelet that shows what a site may have saved: http://potch.me/ls/ (e.g., http://twitter.com/ used localStorage when I tested).

http://www.w3.org/TR/webstorage/
http://en.wikipedia.org/wiki/Web_storage

(I put the thread in Off-Topic since I want to discuss the privacy/security issues rather than the actual scripting.)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th April 2024 - 06:01 AM