encore icon indicating copy to clipboard operation
encore copied to clipboard

Proposal: Add Support for Setting Multiple Cookies

Open Lenstack opened this issue 1 month ago • 1 comments

Hey, I recently ran into a situation that highlighted a limitation.

One of my service’s endpoints needs to send multiple Set-Cookie headers in a single response. Right now, the framework doesn’t provide a way to emit more than one at a time. If I try to switch the field type to an array, I get an error like:

unsupported type in header: []string

I agree with the proposal mentioned in https://github.com/encoredev/encore/issues/1548

Here’s the example structure:

Image

I believe the second option (using *http.Cookie and []*http.Cookie) is the correct approach, since it aligns with how request cookies are already handled and keeps the API consistent.

Lenstack avatar Dec 01 '25 16:12 Lenstack

I believe []string is supported in the latest version of Encore.

eandre avatar Dec 01 '25 16:12 eandre