class LittleGhost::SessionStores::Filesystem

Filesystem preserves LittleGhost sessions across process restarts in an application-controlled directory. Use it for durable local development, a single-host service, or processes that share a suitable filesystem.

store = LittleGhost::SessionStores::Filesystem.new(
  root: "/var/lib/customer_support/sessions"
)

Configure the resulting store through Configuration#session_store, or pass it directly when opening a Session. Calls for the same session wait for one writer, including when separate Ruby processes share the root.

Safety note: The root contains readable session data and is not encrypted. Its complete path must be application-controlled: anyone able to read it can read session data, and anyone able to replace it can alter sessions.

Session data is stored as ordinary JSON with canonical String keys. A value that cannot be represented that way raises ProtocolError without replacing the previous snapshot. Shared roots require filesystem support for file locking and atomic rename. Waiting for another process does not pause other scheduled fibers. In a scheduled fiber, file transactions use LittleGhost’s shared thread pool. Set Configuration#blocking_pool_capacity during process startup if measurements show calls waiting for its two default workers. Store calls do not accept cancellation or deadlines, so a cross-process lock wait continues until the other process releases it.