Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Dec 10, 2024
1 parent 982bdc0 commit a55fedb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/astro/src/core/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export class AstroSession<TDriver extends SessionDriverName = any> {
}
this.#data ??= new Map();
const lifetime = ttl ?? this.#config.ttl;
// If ttl is numeric, it is the number of seconds until expiry. To get an expiry timestamp, we convert to milliseconds and add to the current time.
const expires = typeof lifetime === 'number' ? Date.now() + lifetime * 1000 : lifetime;
this.#data.set(key, {
data: value,
Expand Down

0 comments on commit a55fedb

Please sign in to comment.