netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Improve coexistence with other django-apps on the same host by setting *_COOKIE_PATH

Open prauscher opened this issue 3 years ago • 2 comments

NetBox version

v3.2.4

Feature type

New functionality

Proposed functionality

While netbox provides one configuration option to specify a different BASE_PATH, It does not set the CSRF_COOKIE_PATH, LANGUAGE_COOKIE_PATH or SESSION_COOKIE_PATH. All Values could be set directly to BASE_PATH or "/", as BASE_PATH already contains a trailing slash or empty string.

Use case

Improve coexistence with other Django-based-projects hosted on the same host. While this can (and probably should) also be achieved by using different cookie-names, setting the path of these cookies probably decreases confusion.

Database changes

None

External dependencies

None

prauscher avatar Oct 13 '22 11:10 prauscher

I think NetBox has reached the point where it should set NetBox-specific defaults, rather than using Django defaults, for all of these types of settings. This would be a separate FR of course. This would reduce conflicts for all users, and also allow users to further customize if they needed to.

Related:

  • https://github.com/netbox-community/netbox/issues/9277
  • https://github.com/netbox-community/netbox/issues/6197

tyler-8 avatar Oct 14 '22 18:10 tyler-8

If you like I can provide a PR to set *_COOKIE_PATH to an appropriate value based on BASE_PATH, but I need an accepted issue first

prauscher avatar Oct 14 '22 21:10 prauscher