mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -72,7 +72,8 @@ class CookieStorage(BaseStorage): | |||||||
|         store, or deletes the cookie. |         store, or deletes the cookie. | ||||||
|         """ |         """ | ||||||
|         if encoded_data: |         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: |         else: | ||||||
|             response.delete_cookie(self.cookie_name) |             response.delete_cookie(self.cookie_name) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -81,7 +81,7 @@ Four storage classes are included: | |||||||
|     SessionStorage for the messages that could not fit in a single cookie. |     SessionStorage for the messages that could not fit in a single cookie. | ||||||
|  |  | ||||||
|     Since it is uses SessionStorage, it also requires Django's |     Since it is uses SessionStorage, it also requires Django's | ||||||
|     ``contrib.session`` application. |     ``contrib.sessions`` application. | ||||||
|  |  | ||||||
| ``'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'`` | ``'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'`` | ||||||
|     This is the default temporary storage class. |     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 |    according to the values in the above :ref:`constants table | ||||||
|    <message-level-constants>`. |    <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/ | .. _Django settings: ../settings/ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user