class ArraySessionHandler implements SessionHandlerInterface

Traits

Properties

protected array $storage

The array of stored values.

Methods

int
secondsUntil(DateInterval|DateTimeInterface|int $delay)

Get the number of seconds until the given DateTime.

int
availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)

Get the "available at" UNIX timestamp.

parseDateInterval(DateInterval|DateTimeInterface|int|null $delay)

If the given value is an interval, convert it to a DateTime instance.

int
currentTime()

Get the current system time as a UNIX timestamp.

string
runTimeForHumans(float $startTime, float|null $endTime = null)

Given a start time, format the total run time for human readability.

__construct(int $minutes)

Create a new array driven handler instance.

bool
open(string $savePath, string $sessionName)

No description

bool
close()

No description

string
create_sid()

Create a new session ID.

bool
validateId(string $id)

Determine if the session ID exists.

false|string
read(string $sessionId)

No description

bool
write(string $sessionId, string $data)

No description

bool
destroy(string $sessionId)

No description

int
gc(int $lifetime)

No description

int
calculateExpiration(int $seconds)

Get the expiration time of the session.

Details

in InteractsWithTime at line 17
protected int secondsUntil(DateInterval|DateTimeInterface|int $delay)

Get the number of seconds until the given DateTime.

Parameters

DateInterval|DateTimeInterface|int $delay

Return Value

int

in InteractsWithTime at line 29
protected int availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)

Get the "available at" UNIX timestamp.

Parameters

DateInterval|DateTimeInterface|int|null $delay

Return Value

int

in InteractsWithTime at line 47
protected DateTimeInterface|int parseDateInterval(DateInterval|DateTimeInterface|int|null $delay)

If the given value is an interval, convert it to a DateTime instance.

Parameters

DateInterval|DateTimeInterface|int|null $delay

Return Value

DateTimeInterface|int

in InteractsWithTime at line 63
protected int currentTime()

Get the current system time as a UNIX timestamp.

Return Value

int

in InteractsWithTime at line 71
protected string runTimeForHumans(float $startTime, float|null $endTime = null)

Given a start time, format the total run time for human readability.

Parameters

float $startTime
float|null $endTime

Return Value

string

at line 25
__construct(int $minutes)

Create a new array driven handler instance.

Parameters

int $minutes

the number of minutes the session should be valid

at line 30
bool open(string $savePath, string $sessionName)

No description

Parameters

string $savePath
string $sessionName

Return Value

bool

at line 35
bool close()

No description

Return Value

bool

at line 43
string create_sid()

Create a new session ID.

Return Value

string

at line 51
bool validateId(string $id)

Determine if the session ID exists.

Parameters

string $id

Return Value

bool

at line 56
false|string read(string $sessionId)

No description

Parameters

string $sessionId

Return Value

false|string

at line 73
bool write(string $sessionId, string $data)

No description

Parameters

string $sessionId
string $data

Return Value

bool

at line 83
bool destroy(string $sessionId)

No description

Parameters

string $sessionId

Return Value

bool

at line 92
int gc(int $lifetime)

No description

Parameters

int $lifetime

Return Value

int

at line 111
protected int calculateExpiration(int $seconds)

Get the expiration time of the session.

Parameters

int $seconds

Return Value

int