Commit ccc972e7 authored by Adrian Holovaty's avatar Adrian Holovaty
Browse files

Fixed #15618 -- CookieStorage storage in messages framework now honors...

Fixed #15618 -- CookieStorage storage in messages framework now honors SESSION_COOKIE_DOMAIN. Thanks for the report and patch, lamby

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15848 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent f71384a5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -72,7 +72,8 @@ class CookieStorage(BaseStorage):
        store, or deletes the cookie.
        """
        if encoded_data:
            response.set_cookie(self.cookie_name, encoded_data)
            response.set_cookie(self.cookie_name, encoded_data,
                domain=settings.SESSION_COOKIE_DOMAIN)
        else:
            response.delete_cookie(self.cookie_name)

+22 −12
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ Four storage classes are included:
    SessionStorage for the messages that could not fit in a single cookie.

    Since it is uses SessionStorage, it also requires Django's
    ``contrib.session`` application.
    ``contrib.sessions`` application.

``'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'``
    This is the default temporary storage class.
@@ -408,4 +408,14 @@ to override. See `Displaying messages`_ above for more details.
   according to the values in the above :ref:`constants table
   <message-level-constants>`.

SESSION_COOKIE_DOMAIN
---------------------

Default: ``None``

The storage backends that use cookies -- ``CookieStorage`` and
``FallbackStorage`` -- use the value of ``SESSION_COOKIE_DOMAIN`` in
setting their cookies. See the :doc:`settings documentation </ref/settings>`
for more information on how this works and why you might need to set it.

.. _Django settings: ../settings/