MCPcopy Create free account
hub / github.com/adonisjs/session / touch

Method touch

src/stores/database.ts:197–206  ·  view source on GitHub ↗

* Updates the session expiry time in the database * * @param sessionId - Session identifier * * @example * await store.touch('sess_abc123')

(sessionId: string)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected