Skip to content

Adding note about the PdoSessionHandler BC break #12890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 8, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions UPGRADE-2.6.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
UPGRADE FROM 2.5 to 2.6
=======================

Known Backwards-Compatability Breaks
------------------------------------

* If you use the `PdoSessionHandler`, the session table now has a different
schema and must be modified. Look below for more details.

Form
----

Expand Down Expand Up @@ -106,6 +112,20 @@ HttpFoundation
--------------

* The `PdoSessionHandler` to store sessions in a database changed significantly.
This introduced a **backwards-compatability** break in the schema of the
session table. The following changes must be made to your session table:

- Add a new integer column called `sess_lifetime`. Assuming you have the
default column and table names, in MySQL this would be:
ALTER TABLE `session` ADD `sess_lifetime` INT NOT NULL ;
- Change the data column (default: `sess_value`) to be a Blob type. In
MySQL this would be:
ALTER TABLE `session` CHANGE `sess_value` `session_value` BLOB NOT NULL;

There is also an [issue](https://github.com/symfony/symfony/issues/12834)
that affects Windows servers.

The changes to the `PdoSessionHandler` are:
- By default, it now implements session locking to prevent loss of data by concurrent access to the same session.
- It does so using a transaction between opening and closing a session. For this reason, it's not
recommended to use the same database connection that you also use for your application logic.
Expand Down