Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Django remember-me functionality using a separate token
branch: master
Failed to load latest commit information.
auth_remember Merge remote-tracking branch 'dhaaker/master'
example_project Remember auth backend to AuthRememberBackend()
tests Make "python test" work (code taken from django-celery)
.gitignore Ignore data/ dist/ *.egg
CHANGES Update to 0.3 Add proper
README.rst Use correct URLs for Travis status image Drop deprecated execute_manager


Django auth remember app

django-auth-remember supports Django 1.4.10 and later on Python 2.6 and 2.7.

Add the auth_remember authentication backend to django:


Add the remember middleware in your settings, right after AuthenticationMiddleware:


Add auth_remember to INSTALLED_APPS:


Set the cookie name and expire time (optional):

AUTH_REMEMBER_COOKIE_NAME = 'remember_token'
AUTH_REMEMBER_COOKIE_AGE = 86400 * 28  # 4 weeks by default

Set the expire time of the session to browser close (optional):


To remember a user add the following code to your authentication handler:

from auth_remember import remember_user
remember_user(request, user)

Use the user.is_fresh attribute to test if the user is fresh:

{% if user.is_fresh %}
    This user session is fresh
{% else %}
    This user session is NOT fresh
{% endif %}

Under the hood auth_remember uses the session var AUTH_REMEMBER_FRESH to indicate if the user session is fresh. The name of the session var can be changed by setting the AUTH_REMEMBER_SESSION_KEY in you're settings file.

More information



  • Introduce settings for AUTH_REMEMBER_COOKIE_DOMAIN
Something went wrong with that request. Please try again.