ioadres/vue-easysession

vue-session default expire

Closed this issue · 3 comments

How can i set a expire time when i start a session on vue-session

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)`

@ioadres Thanks for your comment
I am using vue-session
import VueSession from 'vue-session'
Vue.use(VueSession)

I think start(exp:10000) is applicable only for vueEasySession but am not sure about it could you please clarify ?

@Shanoog You're right.

The start(exp:10000) is applicable only for vue-easysession.