AnthonyHerve56 commited on
Commit
fb8fcba
1 Parent(s): ecda3bc

fix: session cookie SameSite=None pour HuggingFace Spaces iframe

Browse files
Files changed (1) hide show
  1. LesChatsDeSeatech.py +2 -2
LesChatsDeSeatech.py CHANGED
@@ -777,9 +777,9 @@ search_index, use_faiss = setup_search_index(chunk_embeddings)
777
  # ===== APPLICATION FLASK =====
778
  app = Flask(__name__, static_folder="static", template_folder="templates")
779
  app.secret_key = 'seatech_chat_secret_key'
780
- app.config['SESSION_COOKIE_SECURE'] = False # Important pour d茅veloppement/HTTP
781
  app.config['SESSION_COOKIE_HTTPONLY'] = True
782
- app.config['SESSION_COOKIE_SAMESITE'] = 'Lax'
783
  app.config['PERMANENT_SESSION_LIFETIME'] = 3600 # 1 heure
784
  conversation_history_global = {}
785
  user_profiles_global = {} # Stocker les profils utilisateur plut么t que dans la session Flask
 
777
  # ===== APPLICATION FLASK =====
778
  app = Flask(__name__, static_folder="static", template_folder="templates")
779
  app.secret_key = 'seatech_chat_secret_key'
780
+ app.config['SESSION_COOKIE_SECURE'] = True # HTTPS requis sur HuggingFace Spaces
781
  app.config['SESSION_COOKIE_HTTPONLY'] = True
782
+ app.config['SESSION_COOKIE_SAMESITE'] = 'None' # N茅cessaire pour l'iframe HF
783
  app.config['PERMANENT_SESSION_LIFETIME'] = 3600 # 1 heure
784
  conversation_history_global = {}
785
  user_profiles_global = {} # Stocker les profils utilisateur plut么t que dans la session Flask