dbAuth : How to modify the cookie expiration time?

Hello everyone,

I want to know how to set the expiration time of the session cookie.

I went to my network tab and when I log in on my app, I get a response cookie called “session” with this date :
image

I have trouble finding where this expiration time is set in the app (I don’t find it anywhere in the code).

In the docs it is written :

“customize login session length” : but I can’t seem to find where and how to set this length

Let’s say I want to make the session cookie expire 24 hours after login : how would I do it?

Thanks a lot by advance for your help

On your api side go src > functions> auth.ts

go to the loginOptions function and you will see the expires setting

Oh thank you so much for your answer. I wonder how I missed this. I was looking just underneath at the cookie in the auth handler but didn’t check above in the logIn options…

I knew I had seen this expire setting before but couln’t find it again :slight_smile:

Almost all config for dbAuth lives in api/src/functions/auth.js in the object you give to the DbAuthHandler initialization.