title: Prevent shared session in flask subdomains
body: <p>I have a flask running at <a href="http://base1.homologation.test" rel="nofollow noreferrer">http://base1.homologation.test</a>.</p>
  <p>I also have another flask instance on same server running at <a href="http://base2.homologation.test" rel="nofollow noreferrer">http://base2.homologation.test</a></p>
  <p>they are two different systems, operating independently.</p>
  <p>Whenever I log in to the first one, I can check the session data referring to it in the second, causing both application and security errors.</p>
  <p>How can I prevent the sessions from being shared between the apps, so that each one has its own?</p>
  <p>root views.py</p>
  <pre><code>from flask import *
  from . import app
  
  app.secret_key = 'random string'
  
  @app.route('/', subdomain='base1')
  def base1():
      pass
  
  @app.route('/', subdomain='base2')
  def base2():
      pass
  
  @app.route('/')
  def hqq():
      return render_template('test.html') 
  </code></pre>
  <p>root init.py</p>
  <pre><code>from flask import *
  from .base1 import base1
  from .base2 import base2
  
  app = Flask(__name__)
  
  app.register_blueprint(base1, subdomain='base1')
  app.register_blueprint(base2, subdomain='base2')
  
  import E_Commerce.views
  </code></pre>
  <p>PS: I am using the default session (session['']).</p>