Why is session data empty in Symfony2 and how to access it?

前端 未结 1 502
情书的邮戳
情书的邮戳 2021-02-06 18:26

A third-party PHP application stores data in the user\'s session (using a cookie for PHPSESSID). In this app, the $_SESSION variable contains all this data.

相关标签:
1条回答
  • 2021-02-06 19:21

    I finally solved the problem. Symfony stores its session data in its own directory (app/cache/[environment]/sessions). So the solution is to set the default session path in config.yml:

    framework:
        session:
            save_path: ~
    

    This will set the default path back (for example /var/lib/php5 on Linux) and the legacy app session data is made available to the Symfony app.

    0 讨论(0)
提交回复
热议问题