mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Fixed #20922 -- Allowed customizing the serializer used by contrib.sessions
Added settings.SESSION_SERIALIZER which is the import path of a serializer to use for sessions. Thanks apollo13, carljm, shaib, akaariai, charettes, and dstufft for reviews.
This commit is contained in:
parent
9d1987d767
commit
b0ce6fe656
13 changed files with 218 additions and 77 deletions
|
@ -2403,7 +2403,7 @@ SESSION_ENGINE
|
|||
|
||||
Default: ``django.contrib.sessions.backends.db``
|
||||
|
||||
Controls where Django stores session data. Valid values are:
|
||||
Controls where Django stores session data. Included engines are:
|
||||
|
||||
* ``'django.contrib.sessions.backends.db'``
|
||||
* ``'django.contrib.sessions.backends.file'``
|
||||
|
@ -2446,6 +2446,28 @@ Whether to save the session data on every request. If this is ``False``
|
|||
(default), then the session data will only be saved if it has been modified --
|
||||
that is, if any of its dictionary values have been assigned or deleted.
|
||||
|
||||
.. setting:: SESSION_SERIALIZER
|
||||
|
||||
SESSION_SERIALIZER
|
||||
------------------
|
||||
|
||||
Default: ``'django.contrib.sessions.serializers.JSONSerializer'``
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
|
||||
The default switched from
|
||||
:class:`~django.contrib.sessions.serializers.PickleSerializer` to
|
||||
:class:`~django.contrib.sessions.serializers.JSONSerializer` in Django 1.6.
|
||||
|
||||
Full import path of a serializer class to use for serializing session data.
|
||||
Included serializers are:
|
||||
|
||||
* ``'django.contrib.sessions.serializers.PickleSerializer'``
|
||||
* ``'django.contrib.sessions.serializers.JSONSerializer'``
|
||||
|
||||
See :ref:`session_serialization` for details, including a warning regarding
|
||||
possible remote code execution when using
|
||||
:class:`~django.contrib.sessions.serializers.PickleSerializer`.
|
||||
|
||||
Sites
|
||||
=====
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue