When I redirect to another page after login, all of my information was lost. I’m wondering what’s the best way to persist user information across the whole website. Thanks!
We use Client-Storage
package:
If you don’t want to use a 3rd party package:
- Use
new Mongo.Collection(null)
, passing null will create Client-only collection, and to make it persistent you can use project calledgrounddb
- LocalStorage (be careful not available in Private mode)
- Cookies (be careful might be turned off or not available in Private mode)
Can you explain the use case some more. I just use this.userId() or Meteor.userId() from the Meteor package? It seems to be fine for me so far.