Newer Version Available
Create a Logout Link Component
To log out your users, you can create a custom logout link component.
To log out your users, redirect them to the [/sitePrefix]/secure/logout.jsp path where [/sitePrefix] is your site’s base path (without the /s). If your site doesn’t use a prefix, use an empty string.
Here’s an example of a component that only displays the logout link when a user is authenticated.
Alternatively, you can make calls to the provided system Apex classes to get the login and logout links.
By default, users are redirected to the login page after logging out. You can configure the logout page URL in Experience Workspaces under .