Skip to content
Discussion options

You must be logged in to vote
const cookieHeader = event.cookies.get("auth_session") ?? "";
const sessionId = lucia.readSessionCookie(cookieHeader) ?? "";

await lucia.invalidateSession(sessionId);

I figured out the answer. It turns out that the cookie I was getting from auth_session was already the id that invalidateSession() needed. readSessionCookie() is not needed anymore, I can pass the cookie value directly into invalidateSession().

Fixed code:

const cookieHeader = event.cookies.get("auth_session") ?? "";

await lucia.invalidateSession(cookieHeader); // succeeds

Replies: 6 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@unovil
Comment options

Comment options

You must be logged in to vote
1 reply
@unovil
Comment options

Comment options

You must be logged in to vote
6 replies
@unovil
Comment options

@pilcrowonpaper
Comment options

@unovil
Comment options

@pilcrowonpaper
Comment options

@unovil
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by unovil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants