FilesystemStore class

A simple Dart adaptation of Gorilla's FilesystemStore, storing session data in files. For demonstration only. This is minimal and not production-hardened.

Implemented types

Constructors

FilesystemStore({required String storageDir, List<SecureCookie>? codecs, Options? defaultOptions, bool useEncryption = false, bool useSigning = false, FileSystem? fileSystem, bool pruneOnStartup = false, List<int>? lottery})
Constructor for FilesystemStore. Ensures the storage directory exists.

Properties

codecs List<SecureCookie>
List of codecs used to encode and decode session data.
final
defaultOptions Options
Default options for the session.
final
fileSystem → FileSystem
File system used to manage session files.
final
hashCode int
The hash code for this object.
no setterinherited
lottery List<int>?
Lottery configuration for opportunistic pruning (e.g. 2, 100).
final
pruneOnStartup bool
Whether to prune expired session files when this store is constructed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storageDir String
Directory where session files will be stored.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(Request request, String name) Future<Session>
Retrieves a session based on the request and session name. If no session exists, a new one is created.
override
toString() String
A string representation of this object.
inherited
write(Request request, Response response, Session session) Future<void>
Saves the session data to a file and sets the appropriate cookie.
override

Operators

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