Documentation

SessionHandler
in package
implements SessionHandlerInterface, SessionIdInterface, SessionUpdateTimestampHandlerInterface

Table of Contents

Interfaces

SessionHandlerInterface
SessionIdInterface
SessionUpdateTimestampHandlerInterface

Properties

$collectGarbage  : bool
$data  : string
$db  : DB_mysqli
$maxLifetime  : int

Methods

close()  : bool
Closes the current session. This function is automatically executed when closing the session, or explicitly via session_write_close()
create_sid()  : string
Create a unique session ID
destroy()  : bool
Destroys a session. Called by session_regenerate_id() (with $destroy = true), session_destroy() and when session_decode() fails
gc()  : int|false
Cleans up expired sessions. Called by session_start(), based on session.gc_divisor, session.gc_probability and session.gc_maxlifetime settings
open()  : bool
Re-initialize existing session, or creates a new one. Called when a session starts or when session_start() is invoked
read()  : string|false
Reads the session data from the session storage, and returns the results.
updateTimestamp()  : bool
Updates the last modification timestamp of the session. This function is automatically executed when a session is updated.
validateId()  : bool
Validates a given session ID. A session ID is valid, if a session with that ID already exists. This function is automatically executed when a session is to be started, a session ID is supplied and session.use_strict_mode is enabled.
write()  : bool
Writes the session data to the session storage. Called by session_write_close(), when session_register_shutdown() fails, or during a normal shutdown.

Properties

Methods

close()

Closes the current session. This function is automatically executed when closing the session, or explicitly via session_write_close()

public close() : bool
Return values
bool

create_sid()

Create a unique session ID

public create_sid() : string
Return values
string

destroy()

Destroys a session. Called by session_regenerate_id() (with $destroy = true), session_destroy() and when session_decode() fails

public destroy(string $id) : bool
Parameters
$id : string
Return values
bool

gc()

Cleans up expired sessions. Called by session_start(), based on session.gc_divisor, session.gc_probability and session.gc_maxlifetime settings

public gc(int $max_lifetime) : int|false
Parameters
$max_lifetime : int
Return values
int|false

open()

Re-initialize existing session, or creates a new one. Called when a session starts or when session_start() is invoked

public open(string $path, string $name) : bool
Parameters
$path : string
$name : string
Return values
bool

read()

Reads the session data from the session storage, and returns the results.

public read(string $id) : string|false

Called right after the session starts or when session_start() is called

Parameters
$id : string
Return values
string|false

updateTimestamp()

Updates the last modification timestamp of the session. This function is automatically executed when a session is updated.

public updateTimestamp(string $id, string $data) : bool
Parameters
$id : string
$data : string
Return values
bool

validateId()

Validates a given session ID. A session ID is valid, if a session with that ID already exists. This function is automatically executed when a session is to be started, a session ID is supplied and session.use_strict_mode is enabled.

public validateId(string $id) : bool
Parameters
$id : string
Return values
bool

write()

Writes the session data to the session storage. Called by session_write_close(), when session_register_shutdown() fails, or during a normal shutdown.

public write(string $id, string $data) : bool
Parameters
$id : string
$data : string
Return values
bool

        
On this page

Search results