if app.config['SESSION_COOKIE_DOMAIN'] is not None:
    return app.config['SESSION_COOKIE_DOMAIN']
if app.config['SERVER_NAME'] is not None:
    rv = '.' + app.config['SERVER_NAME'].rsplit(':', 1)[0]
if rv == '.localhost':
    rv = None
if rv is not None:
    path = self.get_cookie_path(app)
if path != '/':
    rv = rv.lstrip('.')
return rv
How to configure a single flask application to handle multiple domains?