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

Closed
opened 2025-12-29 20:19:17 +01:00 by adam · 2 comments
Owner

Originally created by @prauscher on GitHub (Oct 13, 2022).

Originally assigned to: @prauscher on GitHub.

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

Originally created by @prauscher on GitHub (Oct 13, 2022). Originally assigned to: @prauscher on GitHub. ### 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
adam added the status: acceptedtype: feature labels 2025-12-29 20:19:17 +01:00
adam closed this issue 2025-12-29 20:19:17 +01:00
Author
Owner

@tyler-8 commented on GitHub (Oct 14, 2022):

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:

@tyler-8 commented on GitHub (Oct 14, 2022): 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
Author
Owner

@prauscher commented on GitHub (Oct 14, 2022):

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 commented on GitHub (Oct 14, 2022): 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7100