mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 08:46:39 -06:00
Revert "Ensure the cookie domain and path are properly set. Fixes #3197"
This reverts commit 9c4edb4a28
.
Jenkins really doesn't like this.
This commit is contained in:
parent
9c4edb4a28
commit
93d44d5643
@ -32,7 +32,6 @@ from pgadmin.utils import PgAdminModule, driver
|
||||
from pgadmin.utils.preferences import Preferences
|
||||
from pgadmin.utils.session import create_session_interface, pga_unauthorised
|
||||
from pgadmin.utils.versioned_template_loader import VersionedTemplateLoader
|
||||
from pgadmin.utils.paths import get_cookie_path
|
||||
|
||||
# If script is running under python3, it will not have the xrange function
|
||||
# defined
|
||||
@ -577,8 +576,7 @@ def create_app(app_name=None):
|
||||
@app.after_request
|
||||
def after_request(response):
|
||||
if 'key' in request.args:
|
||||
response.set_cookie('PGADMIN_KEY', value=request.args['key'],
|
||||
path=get_cookie_path(), domain=request.host)
|
||||
response.set_cookie('PGADMIN_KEY', value=request.args['key'])
|
||||
|
||||
return response
|
||||
|
||||
|
@ -37,7 +37,6 @@ from pgadmin.settings import get_setting
|
||||
from pgadmin.utils import PgAdminModule
|
||||
from pgadmin.utils.ajax import make_json_response
|
||||
from pgadmin.utils.preferences import Preferences
|
||||
from pgadmin.utils.paths import get_cookie_path
|
||||
|
||||
try:
|
||||
import urllib.request as urlreq
|
||||
@ -799,8 +798,7 @@ def index():
|
||||
if user_languages:
|
||||
language = user_languages.get() or 'en'
|
||||
|
||||
response.set_cookie("PGADMIN_LANGUAGE", value=language,
|
||||
path=get_cookie_path(), domain=request.host)
|
||||
response.set_cookie("PGADMIN_LANGUAGE", language)
|
||||
|
||||
return response
|
||||
|
||||
|
@ -21,7 +21,6 @@ from pgadmin.utils.ajax import success_return, \
|
||||
make_response as ajax_response, internal_server_error
|
||||
from pgadmin.utils.menu import MenuItem
|
||||
from pgadmin.utils.preferences import Preferences
|
||||
from pgadmin.utils.paths import get_cookie_path
|
||||
|
||||
MODULE_NAME = 'preferences'
|
||||
|
||||
@ -200,8 +199,6 @@ def save(pid):
|
||||
language = user_languages.get() or language
|
||||
|
||||
setattr(session, 'PGADMIN_LANGUAGE', language)
|
||||
response.set_cookie("PGADMIN_LANGUAGE", value=language,
|
||||
path=get_cookie_path(),
|
||||
domain=request.host)
|
||||
response.set_cookie("PGADMIN_LANGUAGE", language)
|
||||
|
||||
return response
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
import os
|
||||
|
||||
from flask import url_for
|
||||
from flask_security import current_user, login_required
|
||||
|
||||
|
||||
@ -76,13 +75,3 @@ 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
|
||||
|
@ -27,7 +27,6 @@ from uuid import uuid4
|
||||
from flask import current_app, request, flash, redirect
|
||||
from flask_login import login_url
|
||||
from pgadmin.utils.ajax import make_json_response
|
||||
from pgadmin.utils.paths import get_cookie_path
|
||||
|
||||
try:
|
||||
from cPickle import dump, load
|
||||
@ -292,8 +291,7 @@ class ManagedSessionInterface(SessionInterface):
|
||||
response.set_cookie(
|
||||
app.session_cookie_name,
|
||||
'%s!%s' % (session.sid, session.hmac_digest),
|
||||
expires=cookie_exp, httponly=True, domain=domain,
|
||||
path=get_cookie_path()
|
||||
expires=cookie_exp, httponly=True, domain=domain
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user