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.
__wakeup()  : mixed
Deny object deserialization.
close()  : bool
Close function. See @session_set_save_handler
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
write()  : bool
Write session data. See @session_set_save_handler

Methods

__construct()

public __construct(string $sessionPath, int $expirationTimeInMinutes, HashService $hashService) : mixed
Parameters
$sessionPath : string
$expirationTimeInMinutes : int
$hashService : HashService

__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.

__wakeup()

Deny object deserialization.

public __wakeup() : mixed

close()

Close function. See @session_set_save_handler

public close() : bool
Return values
bool

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

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

Search results