Appropriately set the cookie path. Fixes #3197

This commit is contained in:
Khushboo Vashi
2018-03-19 17:09:19 +00:00
committed by Dave Page
parent 2abff8f5d4
commit 534f1f35fe
7 changed files with 46 additions and 4 deletions

View File

@@ -11,6 +11,7 @@
import os
from flask import url_for
from flask_security import current_user, login_required
@@ -75,3 +76,13 @@ def init_app(app):
'The user does not have permission to read and write to the '
'specified storage directory.'
)
def get_cookie_path():
cookie_root_path = '/'
pgadmin_root_path = url_for('browser.index')
if pgadmin_root_path != '/browser/':
cookie_root_path = pgadmin_root_path.replace(
'/browser/', ''
)
return cookie_root_path