* Updates the session expiry time in the database * * @param sessionId - Session identifier * * @example * await store.touch('sess_abc123')
(sessionId: string)
| 195 | * await store.touch('sess_abc123') |
| 196 | */ |
| 197 | async touch(sessionId: string): Promise<void> { |
| 198 | debug('database store: touching session data %s', sessionId) |
| 199 | |
| 200 | const expiresAt = new Date(Date.now() + this.#ttlSeconds * 1000) |
| 201 | |
| 202 | await this.#client |
| 203 | .from(this.#tableName) |
| 204 | .where('id', sessionId) |
| 205 | .update({ expires_at: expiresAt }) |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * Tags a session with a user ID for tracking user sessions. |