What's `get_class($token)` (before serialization)? What does that class look like? What do the ancestors of it look like? Is the data serialized and unserialized in the same system?
Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Wed, Sep 7, 2016 at 5:16 PM, Thomas Baumann <[email protected]> wrote: > Hi there, > > I have a User entity, that has groups assigned. These groups are held by a > collection: > > /** > * @ORM\ManyToMany(targetEntity="Group", inversedBy="users") > * @ORM\JoinTable(name="user_has_group") > * > * @var Collection > */ > private $groups; > > > This works fine, no issues so far. These user entities are stored in a > session after authentication and get unserialised at some point: > > $token = unserialize($token); > > /** @var UserInterface $user */ > $user = $token->getUser(); > > > The relevant contents of the session looks like this: > > LogicBundle\ORM\Entity\Usergroups";O:33:"Doctrine\ORM\PersistentCollection > ":2:{s:13:"*collection";O:43:"Doctrine\Common\Collections\ArrayCollection > ":1:{s:53:"Doctrine\Common\Collections\ArrayCollectionelements > ";a:0:{}}s:14:"*initialized";b:0;} > *(taken just before unserialize)* > > The collection seems to be there. Unfortunately, after unserialize, the > value of groups is not a collection anymore, but true. To make things > even more weird: this routine calling unserialize works fine on a > different machine. Just on that development machine the groups collections > gets unserialised as value true. On my machine it is fine, on my > colleagues machine also. Even on the development host, session > authentication generally works. Just when doing this unserialize, the > value suddenly is true. > > Any ideas? I am quite clueless. > > Thanks so much! > > /Thomas > > -- > You received this message because you are subscribed to the Google Groups > "doctrine-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
