What are the benefits of using sessionStorage?

advertisements

Just wondering what are the actual benefits of using HTML5's sessionStorage when storing HTML content to be used in a Javascript carousel?

Is it performance related? Load Times? Bandwidth?


Yes you'll use less bandwidth, it'll be better for performance because you can store information in your browser up to 5Mb. It's much more than with cookie.

For instance to set an item in the storage you can do:

sessionStorage.setItem("name1", "value1");

and to get the item

sessionStorage.getItem("name1");

The sessionStorage is relative to each subdomain/domain.