I've implemented a session handler using DynamoDB. It is working correctly, except for when the response is returned from the server and I call json_decode
on it, the nested php serialized session string is broken. I assume storing a serialized session inside a JSON object is not compatible? Is this an escaping issue?
Questions:
- Is there a way to get around this?
- Is it possible to serialize the session in JSON rather than php
serialize()
which I assume is used? This would probably solve the issue.
This is how the original looks when it comes from the DB (note: it's really long so I've cut the end off myself)
_sf2_attributes|a:4:{s:34:"_security.secured_area.target_path";s:36:"http://my.domain";s:10:"some_id";s:13:"abc123";s:8:"userData";O:27:"Some\Symfony\Bundle":49:{s:8:"�*�email";s:27:"
This is how it looks after calling json_decode
on the JSON object this string is inside:
_sf2_attributes|a:4:{s:34:"_security.secured_area.target_path";s:36:"http://my.domain";s:10:"some_id";s:13:"abc123";s:8:"userData";O:27:"Some\Symfony\Bundle":49:{s:8:"
It appears to be truncated where the asterisk is in the original.