Skip to content

Commit 950a03c

Browse files
committed
feat[session]: increase session durations for better UX
1 parent dc0248d commit 950a03c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sim/app/lib/auth.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ export const auth = betterAuth({
3737
session: {
3838
cookieCache: {
3939
enabled: true,
40-
maxAge: 5 * 60, // Cache duration (5 minutes)
40+
maxAge: 24 * 60 * 60, // 24 hours in seconds
4141
},
42+
expiresIn: 30 * 24 * 60 * 60, // 30 days (how long a session can last overall)
43+
updateAge: 24 * 60 * 60, // 24 hours (how often to refresh the expiry)
44+
freshAge: 60 * 60, // 1 hour (or set to 0 to disable completely)
4245
},
4346
account: {
4447
accountLinking: {

0 commit comments

Comments
 (0)