ClassGo
Session\Storage\Disk
class Session\Storage\Disk {
- public function __construct(string ...$storage_paths);
- public function delete(string $id): void;
- public function delete_by_user(string $user_id): int;
- public function load(string $id): string;
- public function prune(int $max_age): void;
- public function save(string $id, string $data): void;
}
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
- The go type
github.com/titpetric/phpscript/stdlib/session.StorageDisk. - Registered by the package
github.com/titpetric/phpscript/stdlib/session. - Built on
github.com/titpetric/phpscript/stdlib/session.StorageDisk.