Skip to content

Commit

Permalink
refactor: make session.config property public
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jan 23, 2024
1 parent ca82c19 commit 4395100
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/session.ts
Expand Up @@ -32,7 +32,6 @@ import type {
* uses a centralized persistence store and
*/
export class Session {
#config: SessionConfig
#store: SessionStoreContract
#emitter: EmitterService
#ctx: HttpContext
Expand Down Expand Up @@ -130,13 +129,12 @@ export class Session {
}

constructor(
config: SessionConfig,
public config: SessionConfig,
storeFactory: SessionStoreFactory,
emitter: EmitterService,
ctx: HttpContext
) {
this.#ctx = ctx
this.#config = config
this.#emitter = emitter
this.#store = storeFactory(ctx, config)
this.#sessionIdFromCookie = ctx.request.cookie(config.cookieName, undefined)
Expand Down Expand Up @@ -423,7 +421,7 @@ export class Session {
/**
* Touch the session id cookie to stay alive
*/
this.#ctx.response.cookie(this.#config.cookieName, this.#sessionId, this.#config.cookie!)
this.#ctx.response.cookie(this.config.cookieName, this.#sessionId, this.config.cookie!)

/**
* Delete the session data when the session store
Expand Down

0 comments on commit 4395100

Please sign in to comment.