← 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),
},
})