LegacyPdoSessionHandler deprecated
class LegacyPdoSessionHandler implements SessionHandlerInterface
deprecated
Session handler using a PDO connection to read and write data.
Session data is a binary string that can contain non-printable characters like the null byte. For this reason this handler base64 encodes the data to be able to save it in a character column.
This version of the PdoSessionHandler does NOT implement locking. So concurrent requests to the same session can result in data loss due to race conditions.
Methods
__construct(PDO $pdo, array $dbOptions = array()) List of available options: * dbtable: The name of the table [required] * dbidcol: The column where to store the session id [default: sessid] * dbdatacol: The column where to store the session data [default: sessdata] * dbtimecol: The column where to store the timestamp [default: sesstime] | ||
open($savePath, $sessionName) {@inheritdoc} | ||
close() {@inheritdoc} | ||
destroy($sessionId) {@inheritdoc} | ||
gc($maxlifetime) {@inheritdoc} | ||
read($sessionId) {@inheritdoc} | ||
write($sessionId, $data) {@inheritdoc} |
Details
__construct(PDO $pdo, array $dbOptions = array())
List of available options: * dbtable: The name of the table [required] * dbidcol: The column where to store the session id [default: sessid] * dbdatacol: The column where to store the session data [default: sessdata] * dbtimecol: The column where to store the timestamp [default: sesstime]
Parameters
PDO | $pdo | A \PDO instance |
array | $dbOptions | An associative array of DB options |
Exceptions
InvalidArgumentException | When "db_table" option is not provided |
open($savePath, $sessionName)
{@inheritdoc}
Parameters
$savePath | ||
$sessionName |
close()
{@inheritdoc}
destroy($sessionId)
{@inheritdoc}
Parameters
$sessionId |
gc($maxlifetime)
{@inheritdoc}
Parameters
$maxlifetime |
read($sessionId)
{@inheritdoc}
Parameters
$sessionId |
write($sessionId, $data)
{@inheritdoc}
Parameters
$sessionId | ||
$data |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.8/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.html