Logging out with remix-auth

Last updated November 24, 2021 by Jacob Paris

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