How secure is HTML5 local Storage for a Mobile Device

后端 未结 1 428
难免孤独
难免孤独 2021-01-20 02:42

I\'m looking to work around some performance issues on a mobile site by storing the data entered on multiple forms into the local Storage.

I will be clearing the da

1条回答
  •  粉色の甜心
    2021-01-20 02:55

    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 讨论(0)
提交回复
热议问题