Middleware and extending the Cookies maxAge #1711
-
I might be missing something, but I noticed in the new Lucia documentation that the cookie's lifetime is extended in the middleware: https://lucia-next.pages.dev/sessions/cookies/nextjs However, it seems like the expiresAt value for the session in the database doesn't get updated. Since the Related: I guess it would be a security risk to just attach the lifetime to the cookie alone and have it not attached on the session in the DB, because then we would loose the ability to invalidate sessions directly in the DB. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I'm not exactly sure what you mean? The cookie lifetime doesn't really matter |
Beta Was this translation helpful? Give feedback.
Ideally we'd like to extend the cookie lifetime when we actually extend the session expiration, but that's not possible in Next.js, so we just extend the cookie lifetime if it exists regardless of whether it's valid or not.