diff --git a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php index f8f05a1ed80ec..b30d136821539 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php +++ b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php @@ -199,7 +199,15 @@ public function serialize() */ public function __unserialize(array $data): void { - [$this->user, $this->authenticated, $this->roles, $this->attributes, $this->roleNames] = $data; + [$this->user, $this->authenticated, $this->roles, $this->attributes] = $data; + + // migration path to 4.3+ + if (null === $this->roleNames = $data[4] ?? null) { + $this->roleNames = []; + foreach ($this->roles as $role) { + $this->roleNames[] = (string) $role; + } + } } /**
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: