Baldinof / roadrunner-bundle

A RoadRunner worker integrated in your Symfony app
MIT License
266 stars 47 forks source link

Cookies not transferred #120

Closed krajcikondra closed 1 year ago

krajcikondra commented 1 year ago

Hi,

I have AuthController, where I set cookie to response. When I use RoadRunner and check response in browser (google developer tools), cookie is missing.

class AuthController {

public funtion signInAction()
{
               $response = new JsonResponse([
                'token' => $token,
                'refresh_token' => $refreshToken->getRefreshToken(),
            ]);
            $response->headers->setCookie(new Cookie('BEARER', 'somethinkg')); // this cookie is missing in response
           return $response;
}
}

There is some problem with transfer cookies in road runner?

Baldinof commented 1 year ago

Hello,

It's working for me on a fresh project, can you provider a reproducer?

What is the curl -v output of the endpoint?

On a frech project I have the Set-Cookie header:

curl -v http://localhost:8080/ping
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /ping HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: no-cache, private
< Content-Type: application/json
< Date: Thu, 29 Jun 2023 15:39:01 GMT
< Set-Cookie: BEARER=somethinkg; path=/; httponly; samesite=lax
< Vary: Accept-Encoding
< X-Robots-Tag: noindex
< Content-Length: 31
<
* Connection #0 to host localhost left intact
{"token":"","refresh_token":""}
krajcikondra commented 1 year ago

Sorry, my bad.During debug I found my mistake in code