phpscript

manual

ClassGo

Session\Storage\Disk

Description

Session\Storage\Disk is session storage backed by files under $storage_path, which resolves inside the application root and must be writable; with no path it uses a directory of this application's own under the operating system's temporary directory.

Session\Storage\Disk is a class phpscript declares.

$object = new Session\Storage\Disk($storage_paths);

Methods

public function delete(string $id): void

delete removes a session from disk.

The go method Delete.

public function delete_by_user(string $user_id): int

delete_by_user removes every session file holding userID, counting what it took. The walk reads each session because the payload is the only place the user appears: a file carries its session id as its name alone.

The go method DeleteByUser.

public function load(string $id): string

load retrieves a session from disk.

The go method Load.

public function prune(int $max_age): void

prune removes sessions whose last save is older than maxAge.

The go method Prune.

public function save(string $id, string $data): void

save atomically writes a session to disk.

The go method Save.

Binding

See also