class SessionMiddleware
implements MiddlewareTarget
import { SessionMiddleware } from "https://deno.land/x/alosaur@v0.33.1/src/security/session/mod.ts";
Middleware for use sessions with signature hash DEFAULTS: DEFAULT_SESSION_COOKIE_KEY: sid DEFAULT_MAX_AGE: day
Constructors
new
SessionMiddleware(store: SessionStore, options: SessionOptions)Creates instance
Methods
private
assignToContext(context: SecurityContext, session: Session)private
createNewSession(context: SecurityContext): Promise<Session>Create new session with expires
private
getSessionIdCookie(context: SecurityContext): string | undefinedprivate
isSessionExpired(session: Session)private
isValidSessionId(sidHash: string, sign: string): booleanprivate
setSessionIdCookie(sessionIdHash: string, context: HttpContext): Promise<void>onPreRequest(context: SecurityContext)
wrapped context on request