vue-session default expire
Closed this issue · 3 comments
Shanoog commented
How can i set a expire time when i start a session on vue-session
ioadres commented
Hi,
You can set a expire time in the session start in milliseconds.
"this.$session.start(exp : milliseconds), initializes a session with a 'session-id'. If you attempt to save a value without having started a new session, the plugin will automatically start a new session. the parameter exp is optional and indicate the time of expiration the session(millisecond)"
the "options", you can set a callback function when the expire session is done
`var options = {
persist: true,
keySession: 'myKeySession',
expireSessionCallback: function () {
window.location.href = '/'
}
}
Vue.use(VueEasySession.install, options)`