Jacob Paris
← Back to all content

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),
Professional headshot

Hey there! I'm a developer, designer, and digital nomad building cool things with Remix, and I'm also writing Moulton, the Remix Community Newsletter

About once per month, I send an email with:

  • New guides and tutorials
  • Upcoming talks, meetups, and events
  • Cool new libraries and packages
  • What's new in the latest versions of Remix

Stay up to date with everything in the Remix community by entering your email below.

Unsubscribe at any time.