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

Interface SessionStoreContract

src/types.ts:73–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 * }
72 */
73export interface SessionStoreContract {
74 /**
75 * Reads session data for a given session ID from the persistence store
76 *
77 * @param sessionId - Unique identifier for the session
78 */
79 read(sessionId: string): Promise<SessionData | null> | SessionData | null
80
81 /**
82 * Writes session data for a given session ID to the persistence store
83 *
84 * @param sessionId - Unique identifier for the session
85 * @param data - Session data to store
86 */
87 write(sessionId: string, data: SessionData): Promise<void> | void
88
89 /**
90 * Removes session data for a given session ID from the persistence store
91 *
92 * @param sessionId - Unique identifier for the session to remove
93 */
94 destroy(sessionId: string): Promise<void> | void
95
96 /**
97 * Updates the lifetime/expiry of a session without modifying the session data
98 *
99 * @param sessionId - Unique identifier for the session to touch
100 */
101 touch(sessionId: string): Promise<void> | void
102}
103
104/**
105 * Extended session store contract that supports tagging sessions with user IDs.

Callers 32

loadMethod · 0.65
getMethod · 0.65
initiateMethod · 0.65
createTestStoreFunction · 0.65
commitMethod · 0.65
commitMethod · 0.65
createTestStoreFunction · 0.65

Implementers 6

FileStoresrc/stores/file.ts
DynamoDBStoresrc/stores/dynamodb.ts
CookieStoresrc/stores/cookie.ts
RedisStoresrc/stores/redis.ts
MemoryStoresrc/stores/memory.ts
DatabaseStoresrc/stores/database.ts

Calls

no outgoing calls

Tested by

no test coverage detected