
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
django-restricted-sessions
Advanced tools
.. image:: https://badge.fury.io/py/django-restricted-sessions.png :target: http://badge.fury.io/py/django-restricted-sessions
.. image:: https://travis-ci.org/mxsasha/django-restricted-sessions.png?branch=master :target: https://travis-ci.org/mxsasha/django-restricted-sessions
.. image:: https://coveralls.io/repos/mxsasha/django-restricted-sessions/badge.png?branch=master& :target: https://coveralls.io/r/mxsasha/django-restricted-sessions?branch=master
Restricts Django sessions to IP and/or user agent.
If the IP or user agent changes after creating the session, the a 400 response is given to the request, the session is flushed (all session data deleted, new session created) and a warning is logged. The goal of this middleware is to make it harder for an attacker to use a session ID they obtained. It does not make abuse of session IDs impossible.
For compatibility with IPv6 privacy extensions, by default only the first 64 bits of an IPv6 address are checked.
The full documentation is at https://django-restricted-sessions.readthedocs.org.
Install django-restricted-sessions::
pip install django-restricted-sessions
Then add it to your middleware after SessionMiddleware::
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
'restrictedsessions.middleware.RestrictedSessionsMiddleware',
....
]
If you use RESTRICTEDSESSIONS_AUTHED_ONLY
, ensure this middleware is added after
AuthenticationMiddleware
so that the request.user
is present.
0.4.0 (2023-06-02) ++++++++++++++++++
0.3.0 (2019-12-03) ++++++++++++++++++
X_FORWARDED_FOR
contains multiple addresses.0.2.0 (2017-04-06) ++++++++++++++++++
object
to django.utils.deprecation.MiddlewareMixin
travis.yml
for more Python versions0.1.4 (2016-07-02) ++++++++++++++++++
0.1.3.1 (2016-05-26) ++++++++++++++++++++
0.1.3 (2016-05-26) ++++++++++++++++++
0.1.2 (2014-03-20) ++++++++++++++++++
0.1.1 (2014-02-18) ++++++++++++++++++
0.1.0 (2014-02-17) ++++++++++++++++++
FAQs
Restrict Django sessions to IP and/or user agent.
We found that django-restricted-sessions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.