-
In the default Indie Stack I notice this createUserSession which includes a mechanism for setting cookie expiration (max-age) const session = await getSession(request);
session.set(USER_SESSION_KEY, userId);
return redirect(redirectTo, {
headers: {
"Set-Cookie": await sessionStorage.commitSession(session, {
maxAge: remember
? 60 * 60 * 24 * 7 // 7 days
: undefined,
}),
},
}); I am trying to figure out how to implement the same in remix-auth. Would it be a matter of changing headers in the action of login? Is this advanced usage example gleaning something useful? |
Beta Was this translation helpful? Give feedback.
Answered by
dvnrsn
Nov 7, 2023
Replies: 1 comment 1 reply
-
You need to do something similar to the advanced usage examples, don't use successRedirect and instead manually save the data to the session. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok this works (edited because I had forgotten the very important
session.set(authenticator.sessionKey, user);