* Creates a new session instance * * @param config - Session configuration * @param storeFactory - Factory function to create session store * @param emitter - Event emitter service * @param ctx - HTTP context
(
public config: SessionConfig,
storeFactory: SessionStoreFactory,
emitter: EmitterService,
ctx: HttpContext
)
| 143 | * @param ctx - HTTP context |
| 144 | */ |
| 145 | constructor( |
| 146 | public config: SessionConfig, |
| 147 | storeFactory: SessionStoreFactory, |
| 148 | emitter: EmitterService, |
| 149 | ctx: HttpContext |
| 150 | ) { |
| 151 | super() |
| 152 | this.#ctx = ctx |
| 153 | this.#emitter = emitter |
| 154 | this.#store = storeFactory(ctx, config) |
| 155 | this.#sessionIdFromCookie = ctx.request.cookie(config.cookieName, undefined) |
| 156 | this.#sessionId = this.#sessionIdFromCookie || randomUUID() |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * Returns the flash messages store for a given mode |
nothing calls this directly
no outgoing calls
no test coverage detected