wiltonsr / ldapAuth

An open source Traefik Middleware that enables authentication via LDAP in a similar way to Traefik Enterprise
https://plugins.traefik.io/plugins/628c9eb7ffc0cd18356a979c/ldap-auth
Apache License 2.0
117 stars 10 forks source link

add extra cookie options #44

Closed fcinqmars closed 1 year ago

fcinqmars commented 1 year ago

Minor change to provide more security on the session cookie:

I noticed that if you authenticate on anything but on the "/" path, the cookie is created with that path. This leads to multiple cookies in the browser set to different paths. Setting the path to "/" fixes that.

Example:

  1. Browse to my domain.com/app/static/image.jpg => Cookie Path: /app/static
  2. Browse to my domain.com/app/static => Cookie Path: /app
  3. Browse to my domain.com => Cookie Path: /

I think for most use cases, having the path on / would makes sense.