DatabaseSessionHandler
class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareInterface
Properties
protected ConnectionInterface | $connection | The database connection instance. |
|
protected string | $table | The name of the session table. |
|
protected int | $minutes | The number of minutes the session should be valid. |
|
protected Container | $container | The container instance. |
|
protected bool | $exists | The existence state of the session. |
Methods
Create a new database session handler instance.
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
Perform an insert operation on the session ID.
Perform an update operation on the session ID.
Get the default payload for the session.
Add the user information to the session payload.
Get the currently authenticated user's ID.
Add the request information to the session payload.
Get the IP address for the current request.
Get the user agent for the current request.
{@inheritdoc}
{@inheritdoc}
Set the existence state for the session.
Details
at line 59
void
__construct(ConnectionInterface $connection, string $table, int $minutes, Container $container = null)
Create a new database session handler instance.
at line 70
open($savePath, $sessionName)
{@inheritdoc}
at line 78
close()
{@inheritdoc}
at line 86
read($sessionId)
{@inheritdoc}
at line 109
protected bool
expired(stdClass $session)
Determine if the session is expired.
at line 118
write($sessionId, $data)
{@inheritdoc}
at line 142
protected void
performInsert(string $sessionId, string $payload)
Perform an insert operation on the session ID.
at line 158
protected int
performUpdate(string $sessionId, string $payload)
Perform an update operation on the session ID.
at line 169
protected array
getDefaultPayload(string $data)
Get the default payload for the session.
at line 192
protected $this
addUserInformation(array $payload)
Add the user information to the session payload.
at line 206
protected mixed
userId()
Get the currently authenticated user's ID.
at line 217
protected $this
addRequestInformation(array $payload)
Add the request information to the session payload.
at line 234
protected string
ipAddress()
Get the IP address for the current request.
at line 244
protected string
userAgent()
Get the user agent for the current request.
at line 252
destroy($sessionId)
{@inheritdoc}
at line 262
gc($lifetime)
{@inheritdoc}
at line 272
protected Builder
getQuery()
Get a fresh query builder instance for the table.
at line 283
SessionHandlerInterface
setExists(bool $value)
Set the existence state for the session.