diff options
| author | Chris McDonough <chrism@plope.com> | 2015-06-05 14:06:02 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2015-06-05 14:06:02 -0400 |
| commit | f3c67a4217504bc7f2862ec1616342240738efae (patch) | |
| tree | 9e7452b3ffdc8d4f30739cfc9d898169d6719206 /docs/narr/sessions.rst | |
| parent | 7b4ed3088af03de473ad164c314062c283afce39 (diff) | |
| parent | c1dbb5092d486df5d7fbad8e52cd1dbcc2c834d9 (diff) | |
| download | pyramid-f3c67a4217504bc7f2862ec1616342240738efae.tar.gz pyramid-f3c67a4217504bc7f2862ec1616342240738efae.tar.bz2 pyramid-f3c67a4217504bc7f2862ec1616342240738efae.zip | |
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/narr/sessions.rst')
| -rw-r--r-- | docs/narr/sessions.rst | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/docs/narr/sessions.rst b/docs/narr/sessions.rst index 5c103405a..916c6c1f6 100644 --- a/docs/narr/sessions.rst +++ b/docs/narr/sessions.rst @@ -56,7 +56,7 @@ by using the :meth:`pyramid.config.Configurator.set_session_factory` method. config = Configurator() config.set_session_factory(my_session_factory) -.. warning:: +.. warning:: By default the :func:`~pyramid.session.SignedCookieSessionFactory` implementation is *unencrypted*. You should not use it @@ -112,7 +112,7 @@ Extra attributes: An integer timestamp indicating the time that this session was created. ``new`` - A boolean. If ``new`` is True, this session is new. Otherwise, it has + A boolean. If ``new`` is True, this session is new. Otherwise, it has been constituted from data that was already serialized. Extra methods: @@ -225,7 +225,7 @@ method: request.session.flash('mymessage') The ``flash()`` method appends a message to a flash queue, creating the queue -if necessary. +if necessary. ``flash()`` accepts three arguments: @@ -406,7 +406,7 @@ Checking CSRF Tokens With A View Predicate A convenient way to require a valid CSRF Token for a particular view is to include ``check_csrf=True`` as a view predicate. -See :meth:`pyramid.config.Configurator.add_route`. +See :meth:`pyramid.config.Configurator.add_view`. .. code-block:: python @@ -414,6 +414,12 @@ See :meth:`pyramid.config.Configurator.add_route`. def myview(request): ... +.. note:: + A mismatch of CSRF token is treated like any other predicate miss, and the + predicate system, when it doesn't find a view, raises ``HTTPNotFound`` + instead of ``HTTPBadRequest``, so ``check_csrf=True`` behavior is different + from calling :func:`pyramid.session.check_csrf_token`. + Using the ``session.new_csrf_token`` Method ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
