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

jeddab's avatar

Session is empty after guzzle request

i have problème in server of production (not in the local ) , when i logged in with the same user in two different browsers at the same time , then i send a json data with guzzle to specific urls using one of the browsers , the two users are being logout after visiting any other url or just refresh the current page .

some informations : i'm using redis for sessions ( i tried with file but same problem ) . we have juste migrated to new server and the version of laravel to version 10 ( before it was 5.5 ) . if i logged in with one user , everything works as it should, but with same user in two different browsers redirect to login page after .. , i tried to use dd after and before sending the api with guzzle client => i got the error after sending the api so im sure the problem happen when sending the request to the other serveur using guzzle , version of guzzle is "guzzlehttp/guzzle": "^7.0.1",

.
.
.

  $client = new \GuzzleHttp\Client();

        $options = ['headers' => ['content-type' => 'application/json'], 'body' => 															 
                                 json_encode($wsData,JSON_UNESCAPED_UNICODE)];

        $errors = [];


        try {
            $res = $client->post($url, $options);
            dd($res->getStatusCode() );
      
        } catch (\Throwable $th) {
            \Log::info(json_encode($wsData, JSON_UNESCAPED_UNICODE));
				dd('something wrong');
        }

can anyone help here , im like stuck with this bug

0 likes
0 replies

Please or to participate in this conversation.