class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareInterface (View source)

Properties

protected Connection $connection

The database connection instance.

protected string $table

The name of the session table.

protected bool $exists

The existence state of the session.

Methods

void
__construct(Connection $connection, string $table)

Create a new database session handler instance.

open($savePath, $sessionName)

{@inheritDoc}

close()

{@inheritDoc}

read($sessionId)

{@inheritDoc}

write($sessionId, $data)

{@inheritDoc}

destroy($sessionId)

{@inheritDoc}

gc($lifetime)

{@inheritDoc}

getQuery()

Get a fresh query builder instance for the table.

setExists(bool $value)

Set the existence state for the session.

Details

void __construct(Connection $connection, string $table)

Create a new database session handler instance.

Parameters

Connection $connection
string $table

Return Value

void

open($savePath, $sessionName)

{@inheritDoc}

Parameters

$savePath
$sessionName

close()

{@inheritDoc}

read($sessionId)

{@inheritDoc}

Parameters

$sessionId

write($sessionId, $data)

{@inheritDoc}

Parameters

$sessionId
$data

destroy($sessionId)

{@inheritDoc}

Parameters

$sessionId

gc($lifetime)

{@inheritDoc}

Parameters

$lifetime

protected Builder getQuery()

Get a fresh query builder instance for the table.

Return Value

Builder

SessionHandlerInterface setExists(bool $value)

Set the existence state for the session.

Parameters

bool $value

Return Value

SessionHandlerInterface