misc: change session cookie prefix to be sessionid- (#43043)

This commit is contained in:
Frédéric Péters 2020-05-19 09:28:32 +02:00
parent 47e57c15db
commit 36e55b6865
2 changed files with 3 additions and 3 deletions

View File

@ -5222,13 +5222,13 @@ def test_session_cookie_flags(pub):
formdef = create_formdef()
app = get_app(pub)
resp = app.get('/test/', status=200)
assert resp.headers['Set-Cookie'].startswith('wcs-')
assert resp.headers['Set-Cookie'].startswith('sessionid-')
assert 'httponly' in resp.headers['Set-Cookie']
assert not 'secure' in resp.headers['Set-Cookie']
app = get_app(pub, https=True)
resp = app.get('/test/', status=200)
assert resp.headers['Set-Cookie'].startswith('wcs-')
assert resp.headers['Set-Cookie'].startswith('sessionid-')
assert 'httponly' in resp.headers['Set-Cookie']
assert 'secure' in resp.headers['Set-Cookie']

View File

@ -423,7 +423,7 @@ class QommonPublisher(Publisher, object):
md5_hash = hashlib.md5()
md5_hash.update(force_bytes(self.app_dir))
self.config.session_cookie_name = self.APP_NAME + '-' + md5_hash.hexdigest()[:6]
self.config.session_cookie_name = 'sessionid-%s-%s' % (self.APP_NAME, md5_hash.hexdigest()[:6])
self.config.session_cookie_path = '/'
if debug_cfg.get('logger', True):