interface RedisSessionClientInterface (View source)

internal  
 

Defines the Redis operations required by session lifecycle management.

Methods

bool
connect(string $host, int $port, float $timeout)

Opens the configured endpoint for subsequent session operations.

bool
bool
authenticate(string $password)

Authenticates the connection with the configured secret.

bool
bool
selectDatabase(int $database)

Selects the logical database that owns session keys.

bool
string|null
get(string $key)

Returns a serialized payload or null when the key is absent or expired.

string|null
bool
exists(string $key)

Reports whether the key currently exists.

bool
bool
expire(string $key, int $seconds)

Renews an existing key and reports whether the key was touched.

bool
bool
setex(string $key, int $seconds, string $payload)

Stores a payload with a mandatory expiry.

bool
bool
delete(string $key)

Deletes a key and reports whether Redis executed the operation.

bool
void
close()

Releases the underlying Redis connection.

void

Details

connect

bool connect(string $host, int $port, float $timeout)

Opens the configured endpoint for subsequent session operations.

Parameters

string $host
int $port
float $timeout

Return Value

bool

authenticate

bool authenticate(string $password)

Authenticates the connection with the configured secret.

Parameters

string $password

Return Value

bool

selectDatabase

bool selectDatabase(int $database)

Selects the logical database that owns session keys.

Parameters

int $database

Return Value

bool

get

string|null get(string $key)

Returns a serialized payload or null when the key is absent or expired.

Parameters

string $key

Return Value

string|null

exists

bool exists(string $key)

Reports whether the key currently exists.

Parameters

string $key

Return Value

bool

expire

bool expire(string $key, int $seconds)

Renews an existing key and reports whether the key was touched.

Parameters

string $key
int $seconds

Return Value

bool

setex

bool setex(string $key, int $seconds, string $payload)

Stores a payload with a mandatory expiry.

Parameters

string $key
int $seconds
string $payload

Return Value

bool

delete

bool delete(string $key)

Deletes a key and reports whether Redis executed the operation.

Parameters

string $key

Return Value

bool

close

void close()

Releases the underlying Redis connection.

Return Value

void