PHP: session | Failed to decode session object

不想你离开。 提交于 2019-12-11 11:23:27

问题


I try to add e-commerce features into a legacy project, so I still need my old session-handler. I use PHP v7.1.14 and Session2DB (https://github.com/voku/session2db/tree/4.0.0) in this project. Now I have a strange problem with this "Legacy Project" + Symfony 3.4.4 + Sylius 1.1.0 and the session handling.

Symfony session config:

session:
    storage_id: session.storage.php_bridge
    handler_id: ~

Info: https://symfony.com/doc/3.4/session/php_bridge.html

Error: if I try to login into the admin view of Sylius, I see this error

session_start(): Failed to decode session object. Session has been destroyed

... any idea how I can debug / fix this?

EDIT: If I try to use native php session handling in the legacy project + the above Symfony config I get the following error. So I think the decode error is something in Session2DB.

Failed to unserialize the security token from the session.

... maybe any idea how I can debug / fix this?


回答1:


Im my case, the reason of error was non-encoded output of random_bytes() function stored in session variable.



来源:https://stackoverflow.com/questions/48858473/php-session-failed-to-decode-session-object

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!