From ab900957fe6f8fed90210d501e970e30e4fa05b9 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 4 Dec 2015 11:44:51 -0600 Subject: [PATCH] fixed Cookie parsing stopped after first invalid cookie #1084, thanks paultuckey --- gluon/main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gluon/main.py b/gluon/main.py index 75c1ef5e..3c6a77e5 100644 --- a/gluon/main.py +++ b/gluon/main.py @@ -423,10 +423,13 @@ def wsgibase(environ, responder): # ################################################## if env.http_cookie: - try: - request.cookies.load(env.http_cookie) - except Cookie.CookieError, e: - pass # invalid cookies + for single_cookie in env.http_cookie.split(';'): + single_cookie = single_cookie.strip() + if single_cookie: + try: + request.cookies.load(single_cookie) + except Cookie.CookieError: + pass # single invalid cookie ignore # ################################################## # try load session or create new session file