Skip to content

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

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

Closed
Crovitche-1623 opened this issue Sep 20, 2024 · 3 comments
Labels

Comments

@Crovitche-1623
Copy link
Contributor

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
Contributor Author

Related: OAI/OpenAPI-Specification#1237

@Crovitche-1623
Copy link
Contributor 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.

Copy link

stale bot commented Nov 22, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 22, 2024
@stale stale bot closed this as completed Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant