Skip to content
Myr

Added workaround for Chrome cookies

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 6ab569b · Browse files · 2 files+9 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+9 added−1 removed

  • other:+9 added−1 removed

2 files+9 added−1 removed

modified:flask/sessions.py+7 added-1 removed
190 unmodified lines
191 if app.config['SESSION_COOKIE_DOMAIN'] is not None:192 return app.config['SESSION_COOKIE_DOMAIN']193 if app.config['SERVER_NAME'] is not None:194 # chop of the port which is usually not supported by browsers195 return '.' + app.config['SERVER_NAME'].rsplit(':', 1)[0]195 rv = '.' + app.config['SERVER_NAME'].rsplit(':', 1)[0]196 # Google chrome does not like cookies set to .localhost, so197 # we just go with no domain then. Flask documents anyways that198 # cross domain cookies need a fully qualified domain name199 if rv == '.localhost':200 rv = None201 return rv202203 def get_cookie_path(self, app):204 """Returns the path for which the cookie should be valid. The205 default implementation uses the value from the SESSION_COOKIE_PATH``
106 unmodified lines
modified:CHANGES+2 added
45 unmodified lines
46 very careful with those though because usage outside of macros might47 cause caching.48- Flask will no longer invoke the wrong error handlers if a proxy49 exception is passed through.50- Added a workaround for chrome's cookies in localhost not working51 as intended with domain names.5253Version 0.954-----------55
365 unmodified lines