Logging Out an Authenticated User

Last edit: 


This guide will help you create an authentication form to log out authenticated users.


To follow the steps in this tutorial, you should be familiar with the required directory structure for your codebase, and understand the concept of pages and users.


Logging out an authenticated user is a two-step process:

  1. Create log out form
  2. Embed the log out form

Step 1: Create log out form


name: log_out
resource: Session

{% form method: 'delete' %}
  <button>Log Out</button>
{% endform %}

The difference from logging in, is that you want to destroy the session. You have to send a DELETE request by providing the method: delete attribute to the form tag.

Step 2: Embed the log out form


slug: log-out
<h2>Log out</h2>
{% include_form 'log_out' %}

Next steps

Congratulations! You created a log out for authenticated users. Now you can learn about resetting a user's password:


We are always happy to help with any questions you may have. Check out our Help page, or contact us.