pilcrowonpaper / oslo

A collection of auth-related utilities
https://oslo.js.org
MIT License
1.06k stars 35 forks source link

Incorrect maxAge in cookie #60

Closed Ryiski closed 7 months ago

Ryiski commented 7 months ago

I've been having this issue for the passed few days now where i am logged out when i open my application the next morning.

I found out the the Expires / Max-Age in the cookie is wrong even when i make sessionCookie expires: false in lucia,

it is currently setting the Expires / Max-Age as seconds, when converted to milliseconds i works as expected https://github.com/pilcrowOnPaper/oslo/blob/c1f60eca2137cda93bb7aefed35781d85d12c7b6/src/cookie/index.ts#L80

pilcrowonpaper commented 7 months ago

What framework are you using? This is a known issue in Express. Might be better to use Expires instead

Ryiski commented 7 months ago

i am using expressjs, and do you mean setting the Expires key manually on the cookie?

pilcrowonpaper commented 7 months ago

I meant that we should consider using Expires instead in Lucia. Though, this is expected behavior in Oslo. Can you open a new issue in Lucia to use Expires instead of Max-Age?