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

Enable cookie-based sessions #3050

Closed
kartiksubbarao opened this issue Apr 8, 2019 · 4 comments
Closed

Enable cookie-based sessions #3050

kartiksubbarao opened this issue Apr 8, 2019 · 4 comments

Comments

@kartiksubbarao
Copy link

kartiksubbarao commented Apr 8, 2019

Environment

  • Python version: 3.5.1
  • NetBox version: 2.5.9

Proposed Functionality

Allow users to set SESSION_ENGINE to "django.contrib.sessions.backends.signed_cookies" as described here: https://docs.djangoproject.com/en/2.2/topics/http/sessions/#cookie-session-backend

Use Case

My use case is a high-availability configuration where a VIP (netbox.example.com) is managed by keepalived on a master and hot standby replica. Users point to netbox.example.com in their browser. With cookie-based sessions, if the master crashed and keepalived flipped the VIP over to the replica, user sessions could transparently continue for read operations. (Also see this thread on the mailing list: https://groups.google.com/d/msg/netbox-discuss/1tYF9d-wRl8/pfs1iAYOBAAJ)

Jeremy hinted at the possibility of exposing SESSION_ENGINE in the #2426 discussion. If this is practical to implement, I think it could be helpful for many users who want to deploy netbox in various ways.

Database Changes

I don't know if any database changes are required.

External Dependencies

I don't know if any external dependencies are introduced.

@jeremystretch
Copy link
Member

I'd rather avoid cookie-based sessions for all the reasons listed in the Django documentation, foremost of which the performance implications. Although we don't currently store much in the way of session data, I expect that we will once we have the change to make some UI improvements (table column ordering, for example).

As an alternative, NetBox v2.6 will introduce support for caching (via Redis). It's probably worth exploring that as an alternative to database- and file-based session storage, but that would be a separate FR.

@kartiksubbarao
Copy link
Author

Ok. Can you suggest any alternate ideas for fixing/working around the issues that people are seeing with #2426?

@jeremystretch
Copy link
Member

#2426 was a feature request that has been closed and implemented, but you're welcome to open a new bug for the issue (please be sure to complete the bug report template).

@kartiksubbarao
Copy link
Author

Ok, I've opened #3118

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants