From 00ff83e7670b87b1651ed1037dff18d60ca74751 Mon Sep 17 00:00:00 2001 From: Falmarri Date: Mon, 10 Feb 2014 11:37:41 -0700 Subject: [PATCH] Update session callback Cookies are being set on requests regardless of the fact that the session was never accessed. This was causing me problems because I have a cookie path set to something other than what my static resources live under. So all calls to all static resources were generating a new cookie which was being sent back to my client, clobbering the real cookie. --- pyramid_beaker/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyramid_beaker/__init__.py b/pyramid_beaker/__init__.py index 166e84a..3a4b2d3 100644 --- a/pyramid_beaker/__init__.py +++ b/pyramid_beaker/__init__.py @@ -25,8 +25,8 @@ def __init__(self, request): SessionObject.__init__(self, request.environ, **self._options) def session_callback(request, response): exception = getattr(request, 'exception', None) - if (exception is None or self._cookie_on_exception - and self.accessed()): + if (exception is None or self._cookie_on_exception) \ + and self.accessed(): self.persist() headers = self.__dict__['_headers'] if headers['set_cookie'] and headers['cookie_out']: