vagrillo commited on
Commit
d18fd51
·
verified ·
1 Parent(s): 4100ddb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -21,10 +21,13 @@ def set_auth_cookie(response):
21
  "true",
22
  expires=expires,
23
  httponly=True,
24
- secure=False
 
 
25
  )
26
  return response
27
 
 
28
  @app.route('/')
29
  def index():
30
  # Se l'utente è già autenticato, mostra il contenuto normale
@@ -162,7 +165,7 @@ def login():
162
  def logout():
163
  """Route per il logout (elimina il cookie)"""
164
  response = make_response(redirect(url_for('login')))
165
- response.set_cookie(COOKIE_NAME, '', expires=0)
166
  return response
167
 
168
  # Proteggi tutte le route aggiuntive che potresti avere
 
21
  "true",
22
  expires=expires,
23
  httponly=True,
24
+ secure=False,
25
+ path='/', # Aggiungi questo
26
+ samesite='Lax' # Aggiungi questo
27
  )
28
  return response
29
 
30
+
31
  @app.route('/')
32
  def index():
33
  # Se l'utente è già autenticato, mostra il contenuto normale
 
165
  def logout():
166
  """Route per il logout (elimina il cookie)"""
167
  response = make_response(redirect(url_for('login')))
168
+ response.set_cookie(COOKIE_NAME, '', expires=0, path='/') # Aggiungi path='/'
169
  return response
170
 
171
  # Proteggi tutte le route aggiuntive che potresti avere