erase lingering sessionStorage values when logging out

pull/1/head
ansuz 8 years ago
parent 7e7d1f7a16
commit 6f07a3b7b4

@ -82,6 +82,19 @@ define([
if (cb) { cb(); } if (cb) { cb(); }
}; };
var eraseTempSessionValues = common.eraseTempSessionValues = function () {
// delete sessionStorage values that might have been left over
// from the main page's /user redirect
[
'login_user',
'login_pass',
'login_remember',
'register'
].forEach(function (k) {
delete sessionStorage[k];
});
};
var logout = common.logout = function (cb) { var logout = common.logout = function (cb) {
[ [
userNameKey, userNameKey,
@ -97,6 +110,8 @@ define([
if (!localStorage[fileHashKey]) { if (!localStorage[fileHashKey]) {
localStorage[fileHashKey] = common.createRandomHash(); localStorage[fileHashKey] = common.createRandomHash();
} }
eraseTempSessionValues();
if (cb) { cb(); } if (cb) { cb(); }
}; };

Loading…
Cancel
Save