CMS Development

CBelga
Contributor | Platinum Partner
Contributor | Platinum Partner

Password Protected Page Logout

SOLVE

In my understanding, once the correct password is entered on a password-protected HubSpot page, continuous access is granted every time the page is revisited. However, I would like to implement a "Logout" button. This would ensure that users are required to re-enter the password upon each visit, following their decision to log out. Has anyone among you been able to implement this?

0 Upvotes
1 Accepted solution
Jnix284
Solution
Hall of Famer

Password Protected Page Logout

SOLVE

@CBelga because it is a password protected page (using the cookie key) and not a membership page (using sessions) there isn't a way that I know to prevent a returning visitor from accessing the page again unless you change the password or expire the page.

 


If my reply answered your question please mark it as a solution to make it easier for others to find.


Jennifer Nixon

View solution in original post

0 Upvotes
5 Replies 5
SophieHull
Member

Password Protected Page Logout

SOLVE

I believe what you're looking for is a session management feature rather than just a password-protected page. Session management would allow you to log users out after a certain period of inactivity or when they explicitly click a "Logout" button. You might need to use custom code or integrate third-party solutions to achieve this specific functionality with HubSpot.

CBelga
Contributor | Platinum Partner
Contributor | Platinum Partner

Password Protected Page Logout

SOLVE

In this instance, I'm looking to utilize a page that is protected by a password. I'm aware that a cookie is generated once the correct password is entered. This cookie always contains a "_key" and if it's removed, the user will be prompted to re-enter the password upon revisiting the page. However, the cookie with the "_key" is HttpOnly, implying it can only be deleted from the server-side. I attempted to use serverless and "Set-Cookie" to delete the cookie by assigning it an "expires" attribute with a past date value, but it was unsuccessful.

Jnix284
Solution
Hall of Famer

Password Protected Page Logout

SOLVE

@CBelga because it is a password protected page (using the cookie key) and not a membership page (using sessions) there isn't a way that I know to prevent a returning visitor from accessing the page again unless you change the password or expire the page.

 


If my reply answered your question please mark it as a solution to make it easier for others to find.


Jennifer Nixon
0 Upvotes
himanshurauthan
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Password Protected Page Logout

SOLVE

Hello @CBelga 

You can use HubSpot custom module. There is a custom module called "Logout" that can be used to add a logout button to a page.

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Upvotes
CBelga
Contributor | Platinum Partner
Contributor | Platinum Partner

Password Protected Page Logout

SOLVE

I can't seem to find this Logout custom module. What I know is that you can logout a user by creating a button/link that will redirect them to "/_hcms/mem/logout" but this is for a registration required page and does not work for a password required page

0 Upvotes