开发者

How secure is HTML5 local Storage for a Mobile Device

开发者 https://www.devze.com 2023-02-22 11:14 出处:网络
I\'m looking to work around some开发者_如何学JAVA performance issues on a mobile site by storing the data entered on multiple forms into the local Storage.

I'm looking to work around some开发者_如何学JAVA performance issues on a mobile site by storing the data entered on multiple forms into the local Storage.

I will be clearing the data on load and clearing the data on the last page, so no sensitive data will be left on the device after they visit the website on their mobile device.

I do have a couple of concerns though:

  • Can another program access the data I store in local storage?
  • If the user doesn't complete the process can I place a expiration date on the data?

    Example: I want the data to expire in 30 minutes regardless if the user has finished the process, left the site, closed the browser


Take a look at sessionStorage, which works similarly to localStorage but doesn't keep any data once a tab/window/browser is closed.

This would also be more secure than localStorage as no data would be kept once a session has ended. There is more details on security in the W3 Storage spec.

However if you're storing sensitive data I'd recommend cookies as data in sessionStorage and localStorage can be viewed and edited by the user and is potentially open to XSS attacks.

0

精彩评论

暂无评论...
验证码 换一张
取 消