pageballoon / headstart

Decoupled GraphQL-driven content management using OctoberCMS
https://octobercms.com/plugin/nocio-headstart
MIT License
7 stars 2 forks source link

Method Symfony\Component\HttpFoundation\Cookie::__toString() must not throw an exception, caught ErrorException: Array to string conversion #5

Closed SebastiaanKloos closed 4 years ago

SebastiaanKloos commented 4 years ago

Your plugin breaks the RainLab.User plugin. See GIF attached.

Symfony\Component\Debug\Exception\FatalErrorException: Method Symfony\Component\HttpFoundation\Cookie::__toString() must not throw an exception, caught ErrorException: Array to string conversion

CleanShot 2019-11-12 at 11 59 56

frthjf commented 4 years ago

Hi Sebastiaan,

I'm sorry you are experiencing this issue. I'll try and reproduce the problem now and keep you posted.

frthjf commented 4 years ago

Turns out the problem is not a direct problem with Headstart but a consequence of the dependencies of the Lighthouse server. It triggers an upgrade of the Symphony framework, which in turn leads to this known breaking change.

The source of the error then is line 617 in vendor/october/rain/src/Auth/Manager.php:

Cookie::queue(Cookie::forever($this->sessionKey, $toPersist));

where $toPersist is an array and the implicit string conversion fails.

I'm afraid this can only be resolved through the planned move to Laravel 6 which will bump the Symphony dependency.

As a workaround, you have two options:

I hope this helps.