class Illuminate / Session / DatabaseSessionHandler
You are viewing an older version of the documentation. For the latest, please visit master documentation.

DatabaseSessionHandler

Implements

Uses

Properties

protected

$connection ConnectionInterface

The database connection instance.

Default: null
protected

$table string

The name of the session table.

Default: null
protected

$minutes int

The number of minutes the session should be valid.

Default: null
protected

$container Container

The container instance.

Default: null
protected

$exists bool

The existence state of the session.

Default: null

Methods

public

__construct ( ConnectionInterface $connection , $table , $minutes , Container $container ) : void

Create a new database session handler instance.

Parameters

public

open ( $savePath , $sessionName ) : bool

{@inheritdoc}

public

close ( ) : bool

{@inheritdoc}

public

read ( $sessionId ) : string|false

{@inheritdoc}

protected

expired ( $session ) : bool

Determine if the session is expired.

Parameters

  • $session stdClass
public

write ( $sessionId , $data ) : bool

{@inheritdoc}

protected

performInsert ( $sessionId , $payload ) : bool|null

Perform an insert operation on the session ID.

Parameters

  • $sessionId string
  • $payload array
protected

performUpdate ( $sessionId , $payload ) : int

Perform an update operation on the session ID.

Parameters

  • $sessionId string
  • $payload array
protected

getDefaultPayload ( $data ) : array

Get the default payload for the session.

Parameters

  • $data string
protected

addUserInformation ( $payload ) : $this

Add the user information to the session payload.

Parameters

  • $payload array
protected

userId ( ) : mixed

Get the currently authenticated user's ID.

protected

addRequestInformation ( $payload ) : $this

Add the request information to the session payload.

Parameters

  • $payload array
protected

ipAddress ( ) : string

Get the IP address for the current request.

protected

userAgent ( ) : string

Get the user agent for the current request.

public

destroy ( $sessionId ) : bool

{@inheritdoc}

public

gc ( $lifetime ) : int|false

{@inheritdoc}

protected

getQuery ( ) : Builder

Get a fresh query builder instance for the table.

public

setContainer ( $container ) : $this

Set the application instance used by the handler.

Parameters

public

setExists ( $value ) : $this

Set the existence state for the session.

Parameters

  • $value bool