How to fix Memberstack showing users as logged in when they're actually not?
Guys, I am not sure if it's a known issue but in memberstack it often on our site shows people as logged in when they are not and refreshing shows them their fresh logged in state.
As in it doesn't have the ms_mem local storage item. Or basically for all purposes of memberstack including using js to get logged in state, user is not logged in.
But still on the login button, it shows people as logged in. Reproducing wise, it comes off when there's stale login states. And has happened often. I just can't reproduce just now.
That's how we get the auth info to figure out on the backend how to treat the user.
Comments
2 comments
Ideally logout redirects should take care of this by default while using modal based authentication as well. But in case, your setup is different, does setting something like this help your use-case?
Uhmm... It would be nice if you could tell me the steps to reproduce so I can take a closer look.
Are you using Webflow? Or using custom code? Maybe your site is in React? The only way I've seen a similar scenario where people get to see some get to see elements as if they were logged in but they are not is if you're manually handling the logout by clearing out the localstorage object yourself. Memberstack has two objects that uses to track the auth session _ms-mem, and _ms-mid. If your site still keeps the _ms-mid, when refreshing or changing the page, it will repopulate the _ms-mem object and the user would still be logged in.
I'm not sure if you're using a custom way to log people out, the $memberstackDom.logout() method should handle the session token removal effectively
Please sign in to leave a comment.