我目前正在我的本地计算机上进行测试,因此当用户按下Sign out
// The ********** is my site name, which i don't want releasing yet
http://localhost:8080/**********/logout/
本地存储项目:
Key: tkn Value: EE8D9DA0F1D71A0BE8B80F3BA80343555655871151tk16
我尝试过以下测试:
if (localStorage.getItem('tkn')) {
localStorage.clear();
}
if (localStorage.getItem('tkn')) {
localStorage.removeItem('tkn');
}
// I've also ran these both tests in the console of the browser
// and they return back 'undefined' but the item is cleared.
然而,当我sign out
时,用户会话被完全删除。但是localStorage似乎没有被清除。
有人可以为我粉碎这一点吗?