From: Bret Taylor Date: Fri, 5 Feb 2010 18:24:57 +0000 (-0800) Subject: Support passing in cookie value directly in cases where you have to parse the value... X-Git-Tag: v1.0.0~76^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef83f4b6cafabbc3183db061c03faf5cf58d6808;p=thirdparty%2Ftornado.git Support passing in cookie value directly in cases where you have to parse the value from other sources (e.g., from the URL for Flash requests). Also fix documentation error for Facebook Connect. --- diff --git a/tornado/auth.py b/tornado/auth.py index a88451555..ca352b3b7 100644 --- a/tornado/auth.py +++ b/tornado/auth.py @@ -676,7 +676,7 @@ class FacebookMixin(object): tornado.auth.FacebookMixin): @tornado.web.asynchronous def get(self): - if self.get_argument("auth_token", None): + if self.get_argument("session", None): self.get_authenticated_user(self.async_callback(self._on_auth)) return self.authenticate_redirect() diff --git a/tornado/web.py b/tornado/web.py index 403c25cb8..55c6816af 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -266,7 +266,7 @@ class RequestHandler(object): value = "|".join([value, timestamp, signature]) self.set_cookie(name, value, expires_days=expires_days, **kwargs) - def get_secure_cookie(self, name, include_name=True): + def get_secure_cookie(self, name, include_name=True, value=None): """Returns the given signed cookie if it validates, or None. In older versions of Tornado (0.1 and 0.2), we did not include the @@ -276,7 +276,7 @@ class RequestHandler(object): your users out whose cookies were written with a previous Tornado version). """ - value = self.get_cookie(name) + if value is None: value = self.get_cookie(name) if not value: return None parts = value.split("|") if len(parts) != 3: return None