← Back to Guides

Logging out with remix-auth

The easiest way to log a user out is to destroy their session on the server

In your logout action

return redirect("/", {
headers: {
"Set-Cookie": await destroySession(session),

Want news and updates?

Join a handful of people who get my latest content and product updates, directly to your inbox.