Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenApi] How to have multiple Set-Cookie header as PHP does not allow multiple same array key ? #6650

Open
Crovitche-1623 opened this issue Sep 20, 2024 · 2 comments

Comments

@Crovitche-1623
Copy link

In RFC 6265, it's written that :

Origin servers SHOULD NOT fold multiple Set-Cookie header fields into a single header field.

I guess the only way of setting multiple cookie is separating them using a comma yet ?

How to reproduce

use ApiPlatform\OpenApi\Model\Operation;

$fooBarOperation = new Operation(
    // ...
    responses: [
        Response::HTTP_FOUND => [
             // ...
            'headers' => [
                'Set-Cookie' => [
                   // ...
                ],
                // Here I cannot declare another `Set-Cookie` array key
            ]
        ]
    ]
);
@Crovitche-1623 Crovitche-1623 changed the title [OpenAPI] How to have multiple Set-Cookie header as PHP does not allow multiple same array key. [OpenAPI] How to have multiple Set-Cookie header as PHP does not allow multiple same array key ? Sep 20, 2024
@Crovitche-1623 Crovitche-1623 changed the title [OpenAPI] How to have multiple Set-Cookie header as PHP does not allow multiple same array key ? [OpenApi] How to have multiple Set-Cookie header as PHP does not allow multiple same array key ? Sep 20, 2024
@Crovitche-1623
Copy link
Author

Related: OAI/OpenAPI-Specification#1237

@Crovitche-1623
Copy link
Author

BTW, I wanted to decorate the login route to add multiple Set-Cookie header because I use the "Split JWT" mechanism provided by LexikJWTAuthenticationBundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant