We’re encountering an issue while implementing the login and logout functionality on our HubSpot website. We’ve utilized the default membership registration and login features, allowing users to create their accounts. However, it seems there’s an issue with data caching. Even when a user is not logged in, the logout button continues to appear.
thank you for the code.
I think I get the issue now. I assume it’s not a caching thing but more how HubSpot handles this information.
Login information is stored in something like a special CRM property. And as far as I know you can access this information only on a membership/password protected page - simply because its personal data and HubSpot protects it.
You can easily test this if you put this code on a page that is accessible after the actual login page.
Example:
You got this code on every page. Once you log in you’ll be redirected to a different page - this page should then show you “Log out” but if you open a non-password-protected page(what memberships basically are) then you should still see Join now and Log in - even if you’re logged in in a different tab.