Automatically set cookie_path using url_for()

This commit is contained in:
Nate Coraor
2019-04-16 17:48:34 -04:00
committed by John Chilton
parent 7c233a9c2d
commit 449932b229
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -203,7 +203,7 @@ class Configuration(object):
tempfile.tempdir = self.new_file_path
self.shared_home_dir = kwargs.get("shared_home_dir", None)
self.openid_consumer_cache_path = resolve_path(kwargs.get("openid_consumer_cache_path", "database/openid_consumer_cache"), self.root)
self.cookie_path = kwargs.get("cookie_path", "/")
self.cookie_path = kwargs.get("cookie_path", None)
self.enable_quotas = string_as_bool(kwargs.get('enable_quotas', False))
self.enable_unique_workflow_defaults = string_as_bool(kwargs.get('enable_unique_workflow_defaults', False))
self.tool_path = resolve_path(kwargs.get("tool_path", "tools"), self.root)
@@ -88,7 +88,7 @@ class InteractiveEnvironmentRequest(object):
self.attr.proxy_prefix = '/'.join(
(
'',
self.attr.galaxy_config.cookie_path.strip('/'),
(self.attr.galaxy_config.cookie_path or '/').strip('/'),
self.attr.galaxy_config.dynamic_proxy_prefix.strip('/'),
self.attr.viz_id,
)
+1 -1
View File
@@ -625,7 +625,7 @@ class GalaxyWebTransaction(base.DefaultWebTransaction,
Update the session cookie to match the current session.
"""
self.set_cookie(self.security.encode_guid(self.galaxy_session.session_key),
name=name, path=self.app.config.cookie_path)
name=name, path=self.app.config.cookie_path or url_for('/'))
def check_user_library_import_dir(self, user):
if getattr(self.app.config, "user_library_import_dir_auto_creation", False):
+1 -1
View File
@@ -148,7 +148,7 @@ class GolangProxyLauncher(object):
config.dynamic_proxy_bind_port,
),
"--listenPath", "/".join((
config.cookie_path,
(config.cookie_path or '/'),
config.dynamic_proxy_prefix
)),
"--cookieName", "galaxysession",
+1 -1
View File
@@ -48,7 +48,7 @@ class Configuration(object):
self.blog_url = kwargs.get('blog_url', None)
self.screencasts_url = kwargs.get('screencasts_url', None)
self.log_events = False
self.cookie_path = kwargs.get("cookie_path", "/")
self.cookie_path = kwargs.get("cookie_path", None)
# Error logging with sentry
self.sentry_dsn = kwargs.get('sentry_dsn', None)
+1 -1
View File
@@ -66,7 +66,7 @@ class Configuration(object):
# Where dataset files are stored
self.file_path = resolve_path(kwargs.get("file_path", "database/community_files"), self.root)
self.new_file_path = resolve_path(kwargs.get("new_file_path", "database/tmp"), self.root)
self.cookie_path = kwargs.get("cookie_path", "/")
self.cookie_path = kwargs.get("cookie_path", None)
self.enable_quotas = string_as_bool(kwargs.get('enable_quotas', False))
self.id_secret = kwargs.get("id_secret", "changethisinproductiontoo")
# Tool stuff