autoLogOut.js
Use localstorage for update the last user activity with unix-timestamp
Browser Issue
autoLogOut.js implements the event listener on following events:-
- Document ready
- Document unload
- Mouse movement
- Scroll event
- Window resize
- Storage change
All events are throttle with setTimeout approach, except storage change.
For implementation:
var signOut = autoLogOut.init({ timeout: 1, sessionKey: 'Key', debug: true});
signOut.onSignOut = function () {
alert("Called Timeout");
console.log("Timeout Called");
};
autoLogOut.init() function take intial configuration object, each key description mentioned below:-
- timeout: number of minutes after that session will auto logout
- sessionKey: name of the localstorage key
- debug: console.log on event and timeout registration.
autoLogOut.js have three methods:-
- init : initial configuration function
- signOut: manual call the onSignOut callback
- onSignOut: this callback callback on logout