Skip to main content
Module

x/alosaur/security.ts>SessionMiddleware

Alosaur - Deno web framework with many decorators
Very Popular
Go to Latest
class SessionMiddleware
implements MiddlewareTarget
import { SessionMiddleware } from "https://deno.land/x/alosaur@v0.35.2/security.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

Properties

private
readonly
cookieKey: string
private
readonly
publicKey: any

Methods

private
assignToContext(context: SecurityContext, session: Session)
private
createNewSession(context: SecurityContext): Promise<Session>

Create new session with expires

private
getSessionIdCookie(context: SecurityContext): string | undefined
private
isSessionExpired(session: Session)
private
isValidSessionId(sidHash: string, sign: string): boolean
private
setSessionIdCookie(sessionIdHash: string, context: HttpContext): Promise<void>

wrapped context on request