From 3dc946e49e479f1f7d783dd8915e5ad81d145ef7 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 13 Mar 2012 19:23:52 +0000 Subject: [PATCH] Fixed #17236 -- Clarified that anonymous session data are retained after login. Thanks krzysiumed for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17704 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/auth/__init__.py | 3 ++- docs/topics/auth.txt | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py index 141cac7371..3495e16f7a 100644 --- a/django/contrib/auth/__init__.py +++ b/django/contrib/auth/__init__.py @@ -55,7 +55,8 @@ def authenticate(**credentials): def login(request, user): """ Persist a user id and a backend in the request. This way a user doesn't - have to reauthenticate on every request. + have to reauthenticate on every request. Note that data set during + the anonymous session is retained when the user logs in. """ if user is None: user = request.user diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt index cc1e34bb6f..528c7c8718 100644 --- a/docs/topics/auth.txt +++ b/docs/topics/auth.txt @@ -727,6 +727,9 @@ Django provides two functions in :mod:`django.contrib.auth`: using Django's session framework, so, as mentioned above, you'll need to make sure to have the session middleware installed. + Note that data set during the anonymous session is retained when the user + logs in. + This example shows how you might use both :func:`~django.contrib.auth.authenticate()` and :func:`~django.contrib.auth.login()`::