| | |
| | | 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 |
| | |
| | | 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: |
| | |
| | | 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: |
| | | |
| | |
| | | |
| | | 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 |
| | | |
| | |
| | | .. code-block:: python |
| | | |
| | | token = request.session.new_csrf_token() |
| | | |
| | | |