datien228 commited on
Commit
9a8cc46
·
1 Parent(s): 0672089

add cookie to header

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -26,8 +26,11 @@ def recommend():
26
  try:
27
  short_output_summary, long_output_summary = summarize(input_text)
28
  response = jsonify({'short': short_output_summary.strip(), 'long': long_output_summary.strip()})
29
- response.set_cookie('cookie1', 'value1', samesite='Lax')
30
- response.set_cookie('cookie2', 'value2', samesite='None', secure=True)
 
 
 
31
  print(response)
32
  # Pass output summary to the output template
33
  return response
 
26
  try:
27
  short_output_summary, long_output_summary = summarize(input_text)
28
  response = jsonify({'short': short_output_summary.strip(), 'long': long_output_summary.strip()})
29
+ cookie = f'{cookie}; SameSite=None'
30
+ response.headers.add(
31
+ 'Set-Cookie',
32
+ cookie
33
+ )
34
  print(response)
35
  # Pass output summary to the output template
36
  return response