symfony/symfony — Issue #3000: [HttpFoundation] Serialization error with PdoSessionStorage 
Author: pkruithof
Created: 2011-12-30 10:48:29+00:00
State: open

When using PdoSessionStorage, an exception is thrown by PHP when [the session is serialized](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/Session.php#L347):

PDOException: You cannot serialize or unserialize PDO instances

I think the Session class needs to check if the storage can be serialized, maybe by using a NotSerializable interface, as @fabpot [blogged about](http://fabien.potencier.org/article/9/php-serialization-stack-traces-and-exceptions) a while ago.

FYI: this issue is caused by `Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector::serialize()` and only occurs when I forward a request. I'm using the latest Symfony version to date (2.0.8).