summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@digitalartefacts.com>2013-10-19 01:30:58 -0500
committerMichael Merickel <michael@digitalartefacts.com>2013-10-19 01:34:48 -0500
commit8df7a71d99bbeb7819e8a2752012d51202669aa6 (patch)
tree9aaf5abd5dd18f5a7c97ab3b6fc66b75dc7e04d1
parent63bf0587066216f9879ab188691579c9565f0340 (diff)
downloadpyramid-8df7a71d99bbeb7819e8a2752012d51202669aa6.tar.gz
pyramid-8df7a71d99bbeb7819e8a2752012d51202669aa6.tar.bz2
pyramid-8df7a71d99bbeb7819e8a2752012d51202669aa6.zip
update the docs
-rw-r--r--docs/api/session.rst8
-rw-r--r--docs/narr/sessions.rst19
-rw-r--r--docs/quick_tour/package/hello_world/__init__.py4
-rw-r--r--docs/quick_tour/package/hello_world/init.py4
-rw-r--r--docs/quick_tutorial/sessions/tutorial/__init__.py6
-rw-r--r--pyramid/session.py2
6 files changed, 23 insertions, 20 deletions
diff --git a/docs/api/session.rst b/docs/api/session.rst
index 31bc196ad..dde9d20e9 100644
--- a/docs/api/session.rst
+++ b/docs/api/session.rst
@@ -5,12 +5,16 @@
.. automodule:: pyramid.session
- .. autofunction:: UnencryptedCookieSessionFactoryConfig
-
.. autofunction:: signed_serialize
.. autofunction:: signed_deserialize
.. autofunction:: check_csrf_token
+ .. autofunction:: SignedCookieSessionFactory
+
+ .. autofunction:: UnencryptedCookieSessionFactoryConfig
+
+ .. autofunction:: BaseCookieSessionFactory
+
diff --git a/docs/narr/sessions.rst b/docs/narr/sessions.rst
index 358977089..1d914f9ea 100644
--- a/docs/narr/sessions.rst
+++ b/docs/narr/sessions.rst
@@ -43,24 +43,23 @@ limitations:
It is digitally signed, however, and thus its data cannot easily be
tampered with.
-You can configure this session factory in your :app:`Pyramid`
-application by using the ``session_factory`` argument to the
-:class:`~pyramid.config.Configurator` class:
+You can configure this session factory in your :app:`Pyramid` application
+by using the :meth:`pyramid.config.Configurator.set_session_factory`` method.
.. code-block:: python
:linenos:
- from pyramid.session import UnencryptedCookieSessionFactoryConfig
- my_session_factory = UnencryptedCookieSessionFactoryConfig('itsaseekreet')
-
+ from pyramid.session import SignedCookieSessionFactory
+ my_session_factory = SignedCookieSessionFactory('itsaseekreet')
+
from pyramid.config import Configurator
- config = Configurator(session_factory = my_session_factory)
+ config = Configurator()
+ config.set_session_factory(my_session_factory)
.. warning::
- Note the very long, very explicit name for
- ``UnencryptedCookieSessionFactoryConfig``. It's trying to tell you that
- this implementation is, by default, *unencrypted*. You should not use it
+ By default the :func:`~pyramid.session.SignedCookieSessionFactory`
+ implementation is *unencrypted*. You should not use it
when you keep sensitive information in the session object, as the
information can be easily read by both users of your application and third
parties who have access to your users' network traffic. And if you use this
diff --git a/docs/quick_tour/package/hello_world/__init__.py b/docs/quick_tour/package/hello_world/__init__.py
index 6e66bf40a..4a4fbec30 100644
--- a/docs/quick_tour/package/hello_world/__init__.py
+++ b/docs/quick_tour/package/hello_world/__init__.py
@@ -1,7 +1,7 @@
from pyramid.config import Configurator
from pyramid_jinja2 import renderer_factory
# Start Sphinx Include 1
-from pyramid.session import UnencryptedCookieSessionFactoryConfig
+from pyramid.session import SignedCookieSessionFactory
# End Sphinx Include 1
from hello_world.models import get_root
@@ -16,7 +16,7 @@ def main(global_config, **settings):
settings.setdefault('jinja2.i18n.domain', 'hello_world')
# Start Sphinx Include 2
- my_session_factory = UnencryptedCookieSessionFactoryConfig('itsaseekreet')
+ my_session_factory = SignedCookieSessionFactory('itsaseekreet')
config = Configurator(root_factory=get_root, settings=settings,
session_factory=my_session_factory)
# End Sphinx Include 2
diff --git a/docs/quick_tour/package/hello_world/init.py b/docs/quick_tour/package/hello_world/init.py
index 9d7ec43d8..5b5f6a118 100644
--- a/docs/quick_tour/package/hello_world/init.py
+++ b/docs/quick_tour/package/hello_world/init.py
@@ -1,7 +1,7 @@
from pyramid.config import Configurator
from pyramid_jinja2 import renderer_factory
# Start Sphinx 1
-from pyramid.session import UnencryptedCookieSessionFactoryConfig
+from pyramid.session import SignedCookieSessionFactory
# End Sphinx 1
from hello_world.models import get_root
@@ -22,7 +22,7 @@ def main(global_config, **settings):
# End Include
# Start Sphinx Include 2
- my_session_factory = UnencryptedCookieSessionFactoryConfig('itsaseekreet')
+ my_session_factory = SignedCookieSessionFactory('itsaseekreet')
config = Configurator(session_factory=my_session_factory)
# End Sphinx Include 2
diff --git a/docs/quick_tutorial/sessions/tutorial/__init__.py b/docs/quick_tutorial/sessions/tutorial/__init__.py
index ecf57bb32..9ddc2e1b1 100644
--- a/docs/quick_tutorial/sessions/tutorial/__init__.py
+++ b/docs/quick_tutorial/sessions/tutorial/__init__.py
@@ -1,9 +1,9 @@
from pyramid.config import Configurator
-from pyramid.session import UnencryptedCookieSessionFactoryConfig
+from pyramid.session import SignedCookieSessionFactory
def main(global_config, **settings):
- my_session_factory = UnencryptedCookieSessionFactoryConfig(
+ my_session_factory = SignedCookieSessionFactory(
'itsaseekreet')
config = Configurator(settings=settings,
session_factory=my_session_factory)
@@ -11,4 +11,4 @@ def main(global_config, **settings):
config.add_route('home', '/')
config.add_route('hello', '/howdy')
config.scan('.views')
- return config.make_wsgi_app() \ No newline at end of file
+ return config.make_wsgi_app()
diff --git a/pyramid/session.py b/pyramid/session.py
index 803d56066..6ffef7a22 100644
--- a/pyramid/session.py
+++ b/pyramid/session.py
@@ -490,7 +490,7 @@ def SignedCookieSessionFactory(
``salt``
A namespace to avoid collisions between different uses of a shared
secret. Reusing a secret for different parts of an application is
- strongly discouraged.
+ strongly discouraged. Default: ``'pyramid.session.'``.
``cookie_name``
The name of the cookie used for sessioning. Default: ``'session'``.