localStorage items are not modified by setItem()

localStorage items are not modified by setItem()

BY 05 Jul 2013 Web Application Development

Hi.

I’m facing a strage localStorage behavior. After setting some data with setItem() first time, it stays the same every time I try to modify it.

So I’m setting up some options\settings: setItem(‘a’, ‘a’)

Then during app launch:

1) getItem(‘a’) -> ‘a’

2) setItem(‘a’, ‘b’)

3) getItem(‘a’) -> ‘b’

BUT if i kill the app with Task Switcher and restart it getItem(‘a’) gives me ‘a’ again! Any ideas on this issue?

Written by