File: sessions.rst

package info (click to toggle)
python-werkzeug 0.9.6%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 3,096 kB
  • sloc: python: 17,930; makefile: 149; pascal: 60; xml: 16
file content (50 lines) | stat: -rw-r--r-- 1,014 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
========
Sessions
========

.. automodule:: werkzeug.contrib.sessions

.. testsetup::

   from werkzeug.contrib.sessions import *

Reference
=========

.. autoclass:: Session

   .. attribute:: sid
    
      The session ID as string.

   .. attribute:: new

      `True` is the cookie was newly created, otherwise `False`

   .. attribute:: modified

      Whenever an item on the cookie is set, this attribute is set to `True`.
      However this does not track modifications inside mutable objects
      in the session:

      >>> c = Session({}, sid='deadbeefbabe2c00ffee')
      >>> c["foo"] = [1, 2, 3]
      >>> c.modified
      True
      >>> c.modified = False
      >>> c["foo"].append(4)
      >>> c.modified
      False

      In that situation it has to be set to `modified` by hand so that
      :attr:`should_save` can pick it up.

   .. autoattribute:: should_save

.. autoclass:: SessionStore
   :members:

.. autoclass:: FilesystemSessionStore
   :members: list

.. autoclass:: SessionMiddleware