0

I'm having some issues with my Symfony application after upgrading from 2.0.X to 2.1. The application was using PdoSessionStorage just fine before the upgrade. The docs say that there are some differences in the config for PdoSessionStorage in 2.1 but I think that I was able to make those changes okay.

The problem that I'm seeing is that there is no data being added to the session_value(db_data_col) column in the session table. It is adding a new record for the current session but it's leaving the data empty.

Has anyone had this problem yet?

My config contains the following:

framework:
    session:
        handler_id:     session.handler.pdo
parameters:
    pdo.db_options:
        db_table:    session
        db_id_col:   session_id
        db_data_col: session_value
        db_time_col: session_time
services:
    pdo:
        class: PDO
        arguments:
            dsn:         "mysql:host=%database_host%;port=%database_port%;dbname=%database_name%"
            user:        %database_user%
            password:    %database_password%

    session.handler.pdo:
        class:     Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler
        arguments: [@pdo, %pdo.db_options%]
4

2 回答 2

0

弄清楚发生了什么。我们发现了一些修改 $_SESSION 的旧代码。S2.1 将它在 $_SESSION 中使用的键从“_symfony2”更改为“ sf2 *”

于 2012-10-19T00:54:14.527 回答
0

我有同样的问题。查看 PdoSessionHandler.php 代码后,我发现代码依赖于 session_id 是 uniq 的事实。如果您像我一样,并且根据本文创建了会话表,则情况并非如此。

编辑:实际上是这样。我不知道为什么在我的数据库中不是这样

就我而言,要修复它,我必须清空会话表并使 session_id 字段为 uniq

于 2012-10-18T15:12:19.590 回答