Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/alosaur/src/security/session/mod.ts>SessionMiddleware

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

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