If i were to test for localStorage
in the users browser with JavaScript, e.g.
var hasStorage = (function() {
try {
localStorage.setItem(mod, mod);
localStorage.removeItem(mod);
return true;
} catch (exception) {
return false;
}
}());
if (hasStorage) {
// store things in places
}
(from: https://mathiasbynens.be/notes/localstorage-pattern)
Can I infer (without explicit checks) that if hasStorage === true
, then sessionStorage
is also available, or is it possible to have one disabled with the other enabled?