title: flask Set Cookie for every response
body: <p>I use flask session in my app. In one of my handler I set session value and no session set in other handlers. But I found that in every response there is a http header: <code>Set Cookie</code> exists. Why does that happen?</p>
  
  <pre><code>app = Flask(__name__)
  app.secret_key = r"A0Zr98j/3yX R~XHH!jmN'LWX/,?RT"
  
  @app.route('/auth/login', methods=['POST'])
  @crossdomain(origin='*')
  def authlogin():
      user = User(username=username, registered_at=sqlnow())
      user.accounts = [Account(provider='weibo', access_token=access_token, uid=uid)]
      account = user.accounts[0]
  
      session['user_id'] = account.user_id
      return jsonify({
          'status': 'success',
          'data': {
              'user_id': account.user_id,
              'uid': account.uid
          }
      })
  
  @app.route('/api/movies/&lt;movie_type&gt;')
  def moviescoming(movie_type):
      if movie_type == 'coming':
          return getmovies(MOVIE_TYPE_PLAYING, offset, limit)
      else:
          return getmovies(MOVIE_TYPE_COMING, offset, limit)
  
  app.run(host='0.0.0.0', debug=True)
  </code></pre>
  
  <p>Code shows here:
  <a href="https://github.com/aisensiy/dianying/blob/master/index.py" rel="noreferrer">https://github.com/aisensiy/dianying/blob/master/index.py</a></p>