Skip to content

Commit

Permalink
Merge pull request #1793 from ckan/1793-dont-delete-cookies
Browse files Browse the repository at this point in the history
Don't delete all cookies whose names start with "ckan"
  • Loading branch information
David Read committed Jun 27, 2014
2 parents 947737b + 24b147f commit b8943a2
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions ckan/lib/base.py
Expand Up @@ -347,15 +347,9 @@ def __call__(self, environ, start_response):
finally:
model.Session.remove()

# Clean out any old cookies as they may contain api keys etc
# This also improves the cachability of our pages as cookies
# prevent proxy servers from caching content unless they have
# been configured to ignore them.
for cookie in request.cookies:
if cookie.startswith('ckan') and cookie not in ['ckan']:
response.delete_cookie(cookie)
# Remove the ckan session cookie if not used e.g. logged out
elif cookie == 'ckan' and not c.user:
if cookie == 'ckan' and not c.user:
# Check session for valid data (including flash messages)
# (DGU also uses session for a shopping basket-type behaviour)
is_valid_cookie_data = False
Expand Down

0 comments on commit b8943a2

Please sign in to comment.