vue-session icon indicating copy to clipboard operation
vue-session copied to clipboard

"Remember me" persistence?

Open danielalejandromatheus opened this issue 5 years ago • 5 comments

Hey guys, I just got this dependency and so far it's great!

I have a question though, can I make the persistence on the "options" depend on a "remember me" check/token?

danielalejandromatheus avatar Nov 13 '19 14:11 danielalejandromatheus

Don't really know the answer to this but I don't think so at this point.

It could be enabled by setting

Vue.use(VueSession, { persist: true })

But I only tried it from the Vue router.js

SjamonDaal avatar Jan 09 '20 07:01 SjamonDaal

Sorry the title isn't self explanatory, let me elaborate. In some webs you can toggle a persistence with a 'Remember Me' check, what I meant by "Remember Me" persistence is toggling it programmatically from inside a component,, something like:

login(){
//some login logic
if(this.remember){
   this.$session.options.persist = true;
}else this.$session.options.persist = false
this.$session.start()
}

danielalejandromatheus avatar Jan 12 '20 03:01 danielalejandromatheus

I did understand your question but this doesn't work right?

login(){
//some login logic
if(this.remember){
   this.$session.options.persist = true;
}else this.$session.options.persist = false
this.$session.start()
}

SjamonDaal avatar Jan 12 '20 11:01 SjamonDaal

It doesn't, you can either enable it or disable it only when you install it to your Vue instance like you said above

danielalejandromatheus avatar Jan 12 '20 13:01 danielalejandromatheus

Okay, persist also means something else in this case.

In the module it provides crosstab/browser instance persistence of the session.

SjamonDaal avatar Jan 12 '20 13:01 SjamonDaal