class CookieSessionHandler implements SessionHandlerInterface

Traits

Constants

protected REQUEST_CONTEXT_KEY_PREFIX

Context key prefix for the current request.

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(QueueingFactory $cookie, int $minutes, bool $expireOnClose = false)

Create a new cookie driven handler instance.

bool
open(string $savePath, string $sessionName)

No description

bool
close()

No description

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

void
setRequest(Request $request)

Set the request instance.

getRequest()

Get the request instance for the current coroutine.

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 41
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 57
protected int currentTime()

Get the current system time as a UNIX timestamp.

Return Value

int

in InteractsWithTime at line 65
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 29
__construct(QueueingFactory $cookie, int $minutes, bool $expireOnClose = false)

Create a new cookie driven handler instance.

Parameters

QueueingFactory $cookie

the cookie jar instance

int $minutes

the number of minutes the session should be valid

bool $expireOnClose

indicates whether the session should be expired when the browser closes

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

No description

Parameters

string $savePath
string $sessionName

Return Value

bool

at line 41
bool close()

No description

Return Value

bool

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

No description

Parameters

string $sessionId

Return Value

false|string

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

No description

Parameters

string $sessionId
string $data

Return Value

bool

at line 72
bool destroy(string $sessionId)

No description

Parameters

string $sessionId

Return Value

bool

at line 79
int gc(int $lifetime)

No description

Parameters

int $lifetime

Return Value

int

at line 87
void setRequest(Request $request)

Set the request instance.

Parameters

Request $request

Return Value

void

at line 95
protected Request getRequest()

Get the request instance for the current coroutine.

Return Value

Request