Meteor.loginToken

Hi everyone!

What is the best way to get notified on the client when Meteor._localStorage.getItem(‘Meteor.loginToken’) changes?

I want to keep a cookie updated with the token at all times.

Cheers,
David

Not sure if this is sufficient for your needs, but Accounts.onLogin is available on client side as well. Might not cover every case though.

1 Like

This is what I use. On top of this I encrypt the token on the server (with a server side key) and save the encrypted version to the cookie. Cookies are generally considered not safe (enough).