LocalStorage stores user information at login and cleared at logout or expiration...
[myslice.git] / auth / static / js / logout.js
index 9c9b453..593eb58 100644 (file)
@@ -4,7 +4,10 @@ function logout () {
     var username=$(this).data('username');
     var msg="Are you sure you want to logout as " + username + " ?";
     /* redirect to /logout, see urls.py */
-    if (confirm(msg)) window.location="/logout/";
+    if (confirm(msg)){
+        localStorage.removeItem('user');
+        window.location="/logout/";
+    }
 }
 /* attach this function to the logout button */
 $(document).ready(function() { $('#logout').click(logout); $('#logoutbtn').click(logout); });