MCPcopy Create free account
hub / github.com/tinyhttp/tinyhttp / touch

Method touch

packages/session/src/index.ts:668–677  ·  view source on GitHub ↗

* Touch the given session object associated with the given session ID. * @param id Session ID * @param session Session Object * @param cb Callback

(id: string, session: any, cb?: (err?: any) => void)

Source from the content-addressed store, hash-verified

666 * @param cb Callback
667 */
668 touch(id: string, session: any, cb?: (err?: any) => void) {
669 const currentSession = this.getSession(id)
670
671 if (currentSession) {
672 currentSession.cookie = session.cookie
673 this.sessions[session] = JSON.stringify(currentSession)
674 }
675
676 cb && setImmediate(() => cb(null))
677 }
678
679 /**
680 * Get session from the store.

Callers

nothing calls this directly

Calls 1

getSessionMethod · 0.95

Tested by

no test coverage detected