简体   繁体   English

解码Symfony 4基于PdoSessionHandler的数据?

[英]Decode Symfony 4 PdoSessionHandler-based data?

I'm using sessions with a PdoSessionHandler. 我正在使用带有PdoSessionHandler的会话。 Is there a way to deserialize and instantiate each row of the sess_data into a Session object that I can inspect? 有没有一种方法可以将sess_data的每一行反序列化和实例化为我可以检查的Session对象?

Something like session_deocode() in plain php? 像简单的php中的session_deocode()一样?

Thanks to @drumann! 感谢@drumann! I figured out trimming the prefix "_sf2_attributes|" 我发现修剪前缀“ _sf2_attributes |” from sess_data, got me the deserialize version of the Symfony 4 session ie 从sess_data中获得了Symfony 4会话的反序列化版本,即

unserialize(trim($sess_data,"_sf2_attributes|")) 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM