Membership Page Local Proxy Not Working

I’m following these instructions verbatim: Local development - HubSpot docs
My proxied membership pages locally are not respecting the logged in state after having logged in on the live site.

Even if I log in on the live page first and then add hslocal.net:3000 to the domain, the proxied page keeps redirecting me back to the login screen.

@sylvain_tirreau, @SteveHTM, @MichaelMa, @FPConnect would appreciate any insight as I recognize this is an outstanding issue raised here: https://community.hubspot.com/t5/CMS-Development/Problem-while-proxying-public-and-private-pages-CMS-React/m-p/1220151#M44448

Hi @MFall13, getting back to you on this: to get proxied membership pages working locally, here are some steps you can try:

- Start by logging in on your live site at the actual domain (for example, https://yourdomain.com/_hcms/mem/login).
- Next, access the proxied version locally by using either http://hslocal.net:3000 or localhost:3000 with your root domain.
Your authentication cookie from the live site should carry over.
If you’re still being redirected to the login page, here are a few things you can try:

- Be sure you’re using the same browser, cookies won’t transfer if you switch browsers.
- Consider starting the dev server with the --ssl option to enable HTTPS (e.g., https://cmssite.com.hslocal.net:3000/page).
- You can also specify a contact context by adding an email query parameter, like: https://mydomain.hslocal.net:3000/private-page-path?email=your@email.com
If you continue to have trouble, it could be a cookie domain mismatch between your live domain and the local proxy.
And here are some resources for reference:
- Local development
- Memberships

Hope this helps you move forward smoothly!
Have a lovely day!
Bérangère
This post was created with the assistance of AI tools

@BérangèreL Can you share which are the authentication cookie(s) I should see?

Hi @MFall13, the membership system sets cookies when you log in through your live domain (such as https://yourdomain.com/_hcms/mem/login), and these cookies should carry over to your local proxy environment.
While the exact cookie names aren’t detailed in our documentation, you can easily identify them by checking your browser’s cookies after logging in to your live membership page.
This is a helpful way to see which cookies HubSpot’s membership system uses.
Thanks,
Bérangère
This post was created with the assistance of AI tools