2

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?

4
  • 1
    What kind of data are you storing in the sessions? Is it unicode characters by chance? Commented Feb 19, 2018 at 2:37
  • Yes by chance there is also unicode, but the database and the database connection etc. is using utf8mb4. Commented Feb 19, 2018 at 8:48
  • How about serialize()ing? My guess is that the session handler (Session2DB) somehow can't read the data in the session. Commented Feb 19, 2018 at 12:37
  • yes maybe... I found a old blog post about "legacy-session" + Symfony here -> tech.trivago.com/2015/08/26/writing-to-legacy-session and they also recommend to check the "session_encode" from php. Commented Feb 19, 2018 at 14:02

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.