Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

pouyabh's avatar

Can't pull/put session in passport callback route

I install passport in a project and the below code include in route

        $request->session()->put('state', $state = Str::random(40));

and in another project, I include this code

     $state = $request->session()->pull('state');

        throw_unless(
            strlen($state) > 0 && $state === $request->state,
            InvalidArgumentException::class
        );

and error is

RuntimeException
http\Exception\InvalidArgumentException
http://127.0.0.1:8085/callback?code=123&state=123
0 likes
0 replies

Please or to participate in this conversation.