MemorySessionProvider<TUserId> class

SessionProvider implementation that stores all session data in memory.

This is suitable for single-instance services or development purposes. Session data will not be persisted and is gone after restarting the service. maxDuration determines how long a session can live between requests. If set to Duration.zero, sessions will never time out.

Implemented types

Constructors

MemorySessionProvider({Duration maxDuration = const Duration(minutes: 30)})

Properties

hashCode int
The hash code for this object.
no setterinherited
maxDuration Duration
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createSession(TUserId userId) Future<MemorySession<TUserId>>
Creates a new session using the result data given by AuthProvider.
override
getActiveSessions() Future<List<MemorySession<TUserId>>>
Returns all active sessions.
override
getUserSession(TUserId userId) Future<List<MemorySession<TUserId>>>
Finds all active user sessions.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
redeemToken(String sessionToken) Future<MemorySession<TUserId>>
Finds and returns the session associated with the token and resets timeout. Throws if timed out or token invalid.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited