FilesystemStore constructor
FilesystemStore({})
Constructor for FilesystemStore. Ensures the storage directory exists.
Implementation
FilesystemStore({
required this.storageDir,
List<SecureCookie>? codecs,
Options? defaultOptions,
bool useEncryption = false,
bool useSigning = false,
file.FileSystem? fileSystem,
this.pruneOnStartup = false,
this.lottery,
}) : codecs =
codecs ??
[
SecureCookie(
key: SecureCookie.generateKey(),
useEncryption: useEncryption,
useSigning: useSigning,
),
],
defaultOptions = defaultOptions ?? Options(),
fileSystem = fileSystem ?? const local.LocalFileSystem() {
final dir = this.fileSystem.directory(storageDir);
if (!dir.existsSync()) {
dir.createSync(recursive: true);
}
if (pruneOnStartup) {
// Best-effort cleanup of expired sessions
_pruneExpiredFiles();
}
}