Skip to content

DevTools should change default session cookie name to be unique per port #49349

@rwinch

Description

@rwinch

Problem

Session cookies are scoped by host and path only, not by port. Running multiple apps on localhost on different ports (e.g. 8080 and 8081) shares the same cookies, so one app’s session cookie can override the other’s (e.g. logging into one app logs you out of another).

Workarounds and drawbacks

There are a few workarounds that can be used:

  • Developers can use different hosts (127.0.0.1, localhost, 192.168.x.x). The problem with this is that you have to remember host and port per app. Beyond a couple of apps it gets fragile without editing the hosts file.
  • Unique session cookie name (e.g. SESSION_${server.port}). This works well, but requires explicit configuration that should not be required.

Proposed solution

When DevTools is on the classpath, automatically make the default session cookie name unique in development (e.g. suffix with server port, like SESSION_8081), so multiple apps on localhost with different ports don’t overwrite each other’s session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: team-meetingAn issue we'd like to discuss as a team to make progressstatus: waiting-for-triageAn issue we've not yet triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions