Mr-67 commited on
Commit
48d333f
·
verified ·
1 Parent(s): 68c99b3

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +12 -1
main.py CHANGED
@@ -2,8 +2,19 @@ from flask import Flask, render_template, request, redirect, url_for, session
2
  import random
3
  import os
4
  import time
 
5
  app = Flask(__name__)
6
- app.secret_key = os.environ.get("SECRET_KEY", "a_very_long_random_string_here")
 
 
 
 
 
 
 
 
 
 
7
 
8
 
9
  def generate_question(low, high, operation):
 
2
  import random
3
  import os
4
  import time
5
+
6
  app = Flask(__name__)
7
+
8
+ # 1. Update the secret key to be more secure
9
+ app.secret_key = os.environ.get("SECRET_KEY", "math_quiz_default_key_123")
10
+
11
+ # 2. Add this block to fix the "Resetting to Defaults" issue
12
+ app.config.update(
13
+ SESSION_COOKIE_SAMESITE='None',
14
+ SESSION_COOKIE_SECURE=True
15
+ )
16
+
17
+ # ... the rest of your functions (generate_question, etc.) follow below
18
 
19
 
20
  def generate_question(low, high, operation):