RedisSessionClientInterface
interface RedisSessionClientInterface (View source)
| internal |
Defines the Redis operations required by session lifecycle management.
Methods
Opens the configured endpoint for subsequent session operations.
Authenticates the connection with the configured secret.
Selects the logical database that owns session keys.
Returns a serialized payload or null when the key is absent or expired.
Reports whether the key currently exists.
Renews an existing key and reports whether the key was touched.
Stores a payload with a mandatory expiry.
Deletes a key and reports whether Redis executed the operation.
Releases the underlying Redis connection.
Details
connect
bool
connect(string $host, int $port, float $timeout)
Opens the configured endpoint for subsequent session operations.
authenticate
bool
authenticate(string $password)
Authenticates the connection with the configured secret.
selectDatabase
bool
selectDatabase(int $database)
Selects the logical database that owns session keys.
get
string|null
get(string $key)
Returns a serialized payload or null when the key is absent or expired.
exists
bool
exists(string $key)
Reports whether the key currently exists.
expire
bool
expire(string $key, int $seconds)
Renews an existing key and reports whether the key was touched.
setex
bool
setex(string $key, int $seconds, string $payload)
Stores a payload with a mandatory expiry.
delete
bool
delete(string $key)
Deletes a key and reports whether Redis executed the operation.
close
void
close()
Releases the underlying Redis connection.