Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,15 +15,15 @@ print("Salesforce connection established.")
|
|
15 |
# Set the secret key to handle sessions securely
|
16 |
app.secret_key = os.getenv("SECRET_KEY", "sSSjyhInIsUohKpG8sHzty2q") # Replace with a secure key
|
17 |
|
18 |
-
# Session Configuration
|
19 |
-
app.secret_key = os.getenv("SECRET_KEY", "sSSjyhInIsUohKpG8sHzty2q")
|
20 |
app.config["SESSION_TYPE"] = "filesystem"
|
21 |
app.config["SESSION_COOKIE_NAME"] = "biryanihub_session"
|
22 |
-
app.config["SESSION_COOKIE_PATH"] = "/"
|
23 |
-
app.config["
|
24 |
-
app.config["
|
|
|
25 |
app.config["SESSION_PERMANENT"] = False
|
26 |
|
|
|
27 |
# Ensure secure session handling for environments like Hugging Face
|
28 |
app.session_interface = SecureCookieSessionInterface()
|
29 |
print("Session interface configured.")
|
|
|
15 |
# Set the secret key to handle sessions securely
|
16 |
app.secret_key = os.getenv("SECRET_KEY", "sSSjyhInIsUohKpG8sHzty2q") # Replace with a secure key
|
17 |
|
|
|
|
|
18 |
app.config["SESSION_TYPE"] = "filesystem"
|
19 |
app.config["SESSION_COOKIE_NAME"] = "biryanihub_session"
|
20 |
+
app.config["SESSION_COOKIE_PATH"] = "/" # Available across all routes
|
21 |
+
app.config["SESSION_COOKIE_DOMAIN"] = None # Browser determines the domain
|
22 |
+
app.config["SESSION_COOKIE_SECURE"] = False # Set to True if using HTTPS
|
23 |
+
app.config["SESSION_COOKIE_HTTPONLY"] = True # Prevent JS access to the cookie
|
24 |
app.config["SESSION_PERMANENT"] = False
|
25 |
|
26 |
+
|
27 |
# Ensure secure session handling for environments like Hugging Face
|
28 |
app.session_interface = SecureCookieSessionInterface()
|
29 |
print("Session interface configured.")
|