Description
The @asgardeo/nextjs SDK (v0.2.5) currently uses a hardcoded session cookie expiration of 3600 seconds (1 hour). In SessionManager.ts, the getSessionCookieOptions method sets this value using the DEFAULT_EXPIRY_SECONDS constant [1].
As a result, the session cookie expires after one hour regardless of OIDC token validity. The SDK also does not support refresh tokens or sliding sessions, so the session cannot be extended beyond this fixed duration.
It would be useful to make the session expiration configurable or align it with token/session validity, and to consider support for refresh tokens or sliding sessions.
[1]
|
static getSessionCookieOptions(): { |
|
httpOnly: boolean; |
|
maxAge: number; |
|
path: string; |
|
sameSite: 'lax'; |
|
secure: boolean; |
|
} { |
|
return { |
|
httpOnly: true, |
|
maxAge: this.DEFAULT_EXPIRY_SECONDS, |
|
path: '/', |
|
sameSite: 'lax' as const, |
|
secure: process.env['NODE_ENV'] === 'production', |
|
}; |
|
} |
Steps to Reproduce
N/A
Please select the area the issue is related to
@asgardeo/nextjs
Version
v0.2.5
Environment Details (with versions)
No response
Reporter Checklist
Description
The @asgardeo/nextjs SDK (v0.2.5) currently uses a hardcoded session cookie expiration of 3600 seconds (1 hour). In
SessionManager.ts, thegetSessionCookieOptionsmethod sets this value using the DEFAULT_EXPIRY_SECONDS constant [1].As a result, the session cookie expires after one hour regardless of OIDC token validity. The SDK also does not support refresh tokens or sliding sessions, so the session cannot be extended beyond this fixed duration.
It would be useful to make the session expiration configurable or align it with token/session validity, and to consider support for refresh tokens or sliding sessions.
[1]
javascript/packages/nextjs/src/utils/SessionManager.ts
Lines 163 to 177 in a0b8888
Steps to Reproduce
N/A
Please select the area the issue is related to
@asgardeo/nextjs
Version
v0.2.5
Environment Details (with versions)
No response
Reporter Checklist