| Q | A
| ---------------- | -----
| Bug report? | yes
| Feature request? | no
| BC Break report? | yes
| RFC? | yes
| Symfony version | 3.3.*
Please see this issue for details and code snippets.
Passing array values as the cookie value was never supported in Symfony. The contract in Symfony 3.2 and older is string
only: https://github.com/symfony/symfony/blob/3.2/src/Symfony/Component/HttpFoundation/Cookie.php#L38
For 3.3, we actually changed it to allow string|null
.
Btw, I don't see how this could work in 3.2 either. AFAICT, it should also be triggering a Array to string conversion
notice, as it also casts the value to string in 3.2
Most helpful comment
Passing array values as the cookie value was never supported in Symfony. The contract in Symfony 3.2 and older is
string
only: https://github.com/symfony/symfony/blob/3.2/src/Symfony/Component/HttpFoundation/Cookie.php#L38For 3.3, we actually changed it to allow
string|null
.Btw, I don't see how this could work in 3.2 either. AFAICT, it should also be triggering a
Array to string conversion
notice, as it also casts the value to string in 3.2