24 lines
793 B
TypeScript
24 lines
793 B
TypeScript
import {Instantiable} from '../../di'
|
|
import {Maybe} from '../../util'
|
|
import {MemorySession} from './MemorySession'
|
|
import {Session} from './Session'
|
|
import {ConfiguredSingletonFactory} from '../../di/factory/ConfiguredSingletonFactory'
|
|
|
|
export class SessionFactory extends ConfiguredSingletonFactory<Session> {
|
|
protected getConfigKey(): string {
|
|
return 'server.session.driver'
|
|
}
|
|
|
|
protected getDefaultImplementation(): Instantiable<Session> {
|
|
return MemorySession
|
|
}
|
|
|
|
protected getAbstractImplementation(): any {
|
|
return Session
|
|
}
|
|
|
|
protected getDefaultImplementationWarning(): Maybe<string> {
|
|
return 'You are using the default memory-based session driver. It is recommended you configure a persistent session driver instead.'
|
|
}
|
|
}
|