Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

MandarineSecurity.Sessions.SessionStore

import type { MandarineSecurity } from "https://raw.githubusercontent.com/mandarineorg/mandarinets/master/mod.ts"; 

const { SessionStore } = MandarineSecurity.Sessions;

Represents how a SessionStore implementation should be designed. SessionStore is used to design & use the process of manipulating sessions

interface SessionStore {
clearExpiredSessions(): void;
destroy(sessionID: string): void;
exists(sessionID: string): boolean;
get(sessionID: string, config?: {
touch: boolean;
}
): Mandarine.Security.Sessions.MandarineSession | undefined;
getAutoclearExpiredSessions(): boolean;
getDefaultExpiration(): number;
getExpirationInterval(): number;
launch?(): void;
set(
sessionID: string,
config?: {
override: boolean;
}
,
): Mandarine.Security.Sessions.MandarineSession;
touch(sessionID: string): Mandarine.Security.Sessions.MandarineSession | undefined;
}

§Methods

§
clearExpiredSessions(): void
[src]

Handles the elimination of all expired sessions. This function is called in an internal interval managed by Mandarine.

§
destroy(sessionID: string): void
[src]

Removes a session from the session container if it exists

§
exists(sessionID: string): boolean
[src]

Verifies whether a session exists

§
get(sessionID: string, config?: {
touch: boolean;
}
): Mandarine.Security.Sessions.MandarineSession | undefined
[src]

Gets a session. If it does not exist returns undefined. If param config.touch = true, updates the expiration of the session

§

Gets all the sessions in the session container

§
getAutoclearExpiredSessions(): boolean
[src]

Returns a boolean specifying whether expired sessions should be autocleared by an internal handler

§
getDefaultExpiration(): number
[src]

Expiration time of a session (IN MS) Default: (1000 * 60 * 60 * 24) (1 day)

§
getExpirationInterval(): number
[src]

Interval in milliseconds to call expired sessions cleaner Default: (1000 * 60 * 60) (1 hour)

§
launch?(): void
[src]

Prepares session store. Called when mounting session container during Mandarine Build Time (MBT).

§
set(
sessionID: string,
config?: {
override: boolean;
}
,
): Mandarine.Security.Sessions.MandarineSession
[src]

Adds a session to the session container. For overriding, set config.override to true

§
touch(sessionID: string): Mandarine.Security.Sessions.MandarineSession | undefined
[src]

Updates the expiration of a session