Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (8 sloc) 649 Bytes

Session storage is a key value store that allows you to persist serialized objects in [[JSON]] format for a single user session. Session storage persists until the user closes the browser window running your program. Session storage is similar to [[Local Storage]] which behaves the same way, but persists until the user clears their browsing data in the browser settings.


var myJSONString = JSON.stringify({
  propery: 'myfavevalue',
  anotherProp: ['my', 'fave', 'array', 'of', 'strings']

window.localStorage.setItem( 'myData', myJSONString );

window.localStorage.getItem( 'myData' ) //returns myJSONString
Something went wrong with that request. Please try again.