Logging a user out is just a matter of deleting their session. To do that, we just need to place a Button pointing to the DeleteSessionAction when the user is logged in. To check the session we need to import the View Helper from our Application. We can use the Login Button from our navigation bar and instead display a logout button when the user is already logged in. To do that, we can use currentUserOrNothing to check if the user is logged in for the conditional displaying of the Buttons. The Logout button also needs the js-delete and js-delete-no-confirm classes, since we are sending a delete request but we don’t want to have the user confirm the logout. Now, our navbar displays a login button when no user is logged in and a logout button when there is a user logged in.