8000 Allow Configuring the "Domain" Property for Sticky Session Cookies · Issue #11542 · traefik/traefik · GitHub
[go: up one dir, main page]

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

Allow Configuring the "Domain" Property for Sticky Session Cookies #11542

Open
2 tasks done
jleal52 opened this issue Feb 19, 2025 · 1 comment
Open
2 tasks done

Allow Configuring the "Domain" Property for Sticky Session Cookies #11542

jleal52 opened this issue Feb 19, 2025 · 1 comment
Labels
area/service area/sticky-session contributor/wanted Participation from an external contributor is highly requested kind/enhancement a new or improved feature.

Comments

@jleal52
Copy link
jleal52 commented Feb 19, 2025

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you expect to see?

Currently, there is no way to specify the "Domain" attribute for the cookie used in sticky sessions. As a result, when using a load balancer, requests may be redirected to different servers if they are handled within a subdomain structure.

For example, if a system uses multiple subdomains (api.example.com, auth.example.com, app.example.com), the lack of a configurable domain property in the sticky session cookie prevents session persistence across these subdomains. This can lead to unexpected behavior, such as session loss or users being routed inconsistently between different backend servers.

Expected Behavior
It should be possible to define the "Domain" property for the session persistence cookie, allowing for greater flexibility in deployments where multiple subdomains need to share the same sticky session mechanism.

Use Case
A common scenario where this would be useful is when deploying microservices behind Traefik, where services reside on different subdomains but require session stickiness for proper functionality.

For example, setting:

sticky:
  cookie:
    name: "traefik-sticky"
    domain: ".example.com"

would ensure that the session remains persistent across all subdomains of example.com.

Proposed Solution
Introduce an optional "Domain" configuration parameter within the sticky session cookie settings in Traefik, allowing users to define the appropriate scope for session persistence.

Additional Context
This feature would improve session management in multi-subdomain architectures, particularly in environments using authentication services, distributed applications, or microservices with frontend-backend separation.

@emilevauge emilevauge added kind/enhancement a new or improved feature. area/sticky-session area/service contributor/wanted Participation from an external contributor is highly requested and removed status/0-needs-triage labels Feb 20, 2025
@emilevauge
Copy link
Member

Hi @jleal52, thanks for the proposal, it looks like a very good idea, and great way to contribute to the project. If anyone is interessted to work on this, we would love to assist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/service area/sticky-session contributor/wanted Participation from an external contributor is highly requested kind/enhancement a new or improved feature.
Projects
None yet
Development

No branches or pull requests

3 participants
0