Closed
Closed
Copy link

Description
Symfony version(s) affected:
4.4.0-beta2
Description
When using PdoSessionHandler
to store session data, the sess_lifetime
column data type is wrong and leads to a SQLSTATE[22003]: Numeric value out of range error exception
.
I think that before the 4.4 version, the data stored in the column was the lifetime of the session, a duration in seconds. Now it tries to store the expiration time of the session, a Unix timestamp (Is it a wanted behavior?). The data type is MEDIUMINT
under MySQL for the sess_lifetime
column and it cant be used to store a timestamp.
How to reproduce
- Setup a Symfony app using version 4.4.0-beta2.
- Setup PdoSessionHandler with MySQL using the following documentation: https://symfony.com/doc/4.4/doctrine/pdo_session_storage.html#mysql
- Access any page requiring the session to be started, e.g. the login page of your app.
Possible Solution
- Update the
Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::createTable()
method to use the correct data type for thesess_lifetime
column (INTEGER UNSIGNED NOT NULL
). - Update the https://symfony.com/doc/4.4/doctrine/pdo_session_storage.html#mysql page accordingly.
Metadata
Metadata
Assignees
Labels
No labels