Skip to content

Add --scope-cookie-paths#178

Merged
kevinmcconnell merged 1 commit intomainfrom
cookie-path-prefix
Dec 4, 2025
Merged

Add --scope-cookie-paths#178
kevinmcconnell merged 1 commit intomainfrom
cookie-path-prefix

Conversation

@kevinmcconnell
Copy link
Collaborator

Adds a mechanism to automatically scope cookie paths to match --path-prefix.

When --scope-cookie-paths is true and a request matches a --path-prefix, any cookies set by the response will automatically have their paths scoped to the matched prefix.

For example, given a service that is deployed with:

... --path-prefix=/app,api

And a response that sets a cookie like:

Set-Cookie: session=1; Secure; Path=/; Domain=example.com

Then for a request to /app/something, the client will actually receive a cookie header of:

Set-Cookie: session=1; Secure; Path=/app; Domain=example.com

This feature is intended to make it easier to allow multiple, distinct applications to share the same domain by using different paths, without them accidentally clobbering each others' cookies.

Adds a mechanism to automatically scope cookie paths to match
`--path-prefix`.

When `--scope-cookie-paths` is `true` and a request matches a
`--path-prefix`, any cookies set by the response will automatically have
their paths scoped to the matched prefix.

For example, given a service that is deployed with:

    ... --path-prefix=/app,api

And a response that sets a cookie like:

    Set-Cookie: session=1; Secure; Path=/; Domain=example.com

Then for a request to `/app/something`, the client will actually receive
a cookie header of:

    Set-Cookie: session=1; Secure; Path=/app; Domain=example.com

This feature is intended to make it easier to allow multiple, distinct
applications to share the same domain by using different paths, without
them accidentally clobbering each others' cookies.
@kevinmcconnell kevinmcconnell merged commit 6f6316b into main Dec 4, 2025
4 checks passed
@kevinmcconnell kevinmcconnell deleted the cookie-path-prefix branch December 4, 2025 16:49
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

Successfully merging this pull request may close these issues.

1 participant