DatabaseSessionHandler

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}

Builder getQuery()

Get a fresh query builder instance for the table.

SessionHandlerInterface 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

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Session/DatabaseSessionHandler.html