FileSessionHandler

class \TYPO3\CMS\Install\Service\Session\FileSessionHandler

Implements
SessionHandlerInterface
Uses
BlockSerializationTrait

PHP session handling with "secure" session files (hashed session id) see http://www.php.net/manual/en/function.session-set-save-handler.php

Table of Contents

Interfaces

SessionHandlerInterface

Methods

__construct()  : mixed
__destruct()  : mixed
Writes the session data at the end, to overcome a PHP APC bug.
__unserialize()  : void
Deny object deserialization.
close()  : bool
Close function. See @session_set_save_handler
create_sid()  : string
destroy()  : bool
Destroys one session. See @session_set_save_handler
gc()  : int|false
Garbage collect session info. See @session_set_save_handler
getSessionId()  : string|false
Returns the session ID of the running session.
open()  : bool
Open function. See @session_set_save_handler
read()  : string|false
Read session data. See @session_set_save_handler
validateId()  : bool
write()  : bool
Write session data. See @session_set_save_handler

Methods

__construct()

public __construct(int $expirationTimeInMinutes[, string|null $sessionPath = null ]) : mixed

Parameters

$expirationTimeInMinutes : int
$sessionPath : string|null = null

__destruct()

Writes the session data at the end, to overcome a PHP APC bug.

public __destruct() : mixed

Writes the session data in a proper context that is not affected by the APC bug: http://pecl.php.net/bugs/bug.php?id=16721.

This behaviour was introduced in #17511, where self::write() made use of GeneralUtility which due to the APC bug throws a "Fatal error: Class 'GeneralUtility' not found" (and the session data is not saved). Calling session_write_close() at this point seems to be the most easy solution, according to PHP author.

__unserialize()

Deny object deserialization.

public __unserialize(array $data) : void

Parameters

$data : array

close()

Close function. See @session_set_save_handler

public close() : bool

Return values

bool

create_sid()

public create_sid() : string

Return values

string

destroy()

Destroys one session. See @session_set_save_handler

public destroy(string $id) : bool

Parameters

$id : string

Return values

bool

gc()

Garbage collect session info. See @session_set_save_handler

public gc(int $maxLifeTime) : int|false

Parameters

$maxLifeTime : int

The setting of session.gc_maxlifetime

Return values

int|false

getSessionId()

Returns the session ID of the running session.

public getSessionId() : string|false

Return values

string|false —

the session ID

open()

Open function. See @session_set_save_handler

public open(string $path, string $name) : bool

Parameters

$path : string
$name : string

Return values

bool

read()

Read session data. See @session_set_save_handler

public read(string $id) : string|false

Parameters

$id : string

Return values

string|false

validateId()

public validateId(string $id) : bool

Parameters

$id : string

Return values

bool

write()

Write session data. See @session_set_save_handler

public write(string $id, string $data) : bool

Parameters

$id : string
$data : string

Return values

bool
On this page