title: Set a Cookie in flask Redirect to external URL
body: <p>I want to redirect a user from my flask application to the client application with a header (encoded session object) that the browser can store as a cookie for further requests.</p>
  
  <p>I'm authenticating a user using a different server and on a successful sign-in, he is redirected to my flask application where I set the user in the database and the session object. And, right after this is done, I need the request to be redirected to my client application. So, I use flask.redirect to redirect the user to my client application. Now, for the browser to store the user information, I want to send the session object to the browser as a cookie. </p>
  
  <p>TLDR;
  This is what I'm trying to do:</p>
  
  <ol>
  <li>Client reaches content server.</li>
  <li>Client does not have an active session, is redirected to authentication server with a callback to content server.</li>
  <li>Content server creates session and redirects back to Client with session cookie.</li>
  <li>Client reaches Content server.</li>
  <li>Content server verifies session cookie and allows access to client.</li>
  </ol>
  
  <p>Authentication is on a separate server, but the content server and client both need to keep track of the session via a cookie. The part I'm unable to do is make the Client (localhost:3000) keep track of the session.</p>
  
  <p>The following is what I tried: </p>
  
  <pre><code>resp = flask.make_response()
  resp.set_cookie('Set-Cookie', 'this is the session cookie I want the browser to set for further requests')
  return flask.redirect('http://localhost:3000/', Response=resp)
  </code></pre>
  
  <p>This gives me the error:</p>
  
  <pre><code>File "/home/shaily/.virtualenvs/venv/lib/python3.6/site-packages/werkzeug/utils.py", line 507, in redirect
  
  mimetype="text/html",
  
  TypeError: __call__() got an unexpected keyword argument 'mimetype'
  </code></pre>
  
  <p>Is there an alternative or a way I can fix this?</p>