Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sessionStorage in Firefox

in firefox 9, when i do:

var msg = sessionStorage.getItem("message");

The browser ask with the error: "Operation is not supported", firefox not implement the webStorage of html5? or this case is only for sessionStorage and not for localStorage?. Thx.

like image 890
Kalamarico Avatar asked Jan 19 '12 10:01

Kalamarico


People also ask

What is sessionStorage in browser?

sessionStorage is similar to localStorage ; the difference is that while data in localStorage doesn't expire, data in sessionStorage is cleared when the page session ends. Whenever a document is loaded in a particular tab in the browser, a unique page session gets created and assigned to that particular tab.

Where does Firefox store session data?

During runtime Firefox uses files is the sessionstore-backups folder. You will normally find these files in the sessionstore-backups folder: *previous. jsonlz4 (cleanBackup: copy of sessionstore.


1 Answers

Session storage is only available when you are serving your page from a server - you'll find that it doesn't work if you open the HTML page locally because there is no session.

In the case of browsers that may not support session storage, you can test for the feature:

if (window.sessionStorage) {
    ...
like image 85
Fenton Avatar answered Oct 01 '22 20:10

Fenton