[SOLVED] Meteor not saving session, logging out after refresh

Hello, I’m attempting to create my own custom login since it has a little extra complexity of just using the built in login tools. I’ve got these two functions below, one for registering and one for logging in. I can see from using the Meteor chrome extension that logging in does work after registering, however after page refresh it immediately logs out. I’ve also tried to set loginExpiration on the server, to no avail. What steps am I missing here?

Accounts.createUser({username: username, password: password});

Meteor.loginWithPassword(username, password)

Accounts.config({
      loginExpirationInDays: 30
  });

Thank you!

Meteor uses local storage to store login token. Please check to make sure you have token stored and the token should not be removed when you refresh the browser (which normally not)

Thanks, I don’t see anything specific to login. There is a local storage token before login. I guess I’m not sure what I’m really looking for here

I figured this out, looks like it was related to using Brave browser ( a crypto Chromium browser). It hates localhost even with whitelisting.

1 Like

Yep Brave does a lot of this kind of stuff, it also won’t show users in Google Analytics now because tracking is turned off so to get any idea how many are online you need to check at DNS level

1 Like