Spaces:
Sleeping
Sleeping
Update app.py
#1
by
Yaswanth56
- opened
app.py
CHANGED
@@ -126,23 +126,14 @@ from flask import session, redirect, request, url_for, make_response
|
|
126 |
|
127 |
@app.route("/logout")
|
128 |
def logout():
|
129 |
-
# Clear session
|
130 |
-
session.
|
131 |
-
|
132 |
-
session.pop('rewardPoints', None)
|
133 |
-
session.pop('coupon', None)
|
134 |
-
|
135 |
-
# Create the redirect response
|
136 |
response = redirect("https://biryanihub-dev-ed.develop.my.salesforce-sites.com/PublicLogin")
|
137 |
-
|
138 |
-
# Add headers to prevent caching (optional, but helpful)
|
139 |
-
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
|
140 |
-
response.headers['Pragma'] = 'no-cache'
|
141 |
-
response.headers['Expires'] = '0'
|
142 |
-
|
143 |
-
# Return the response with the added headers
|
144 |
return response
|
145 |
|
|
|
146 |
@app.route("/signup", methods=["GET", "POST"])
|
147 |
def signup():
|
148 |
if request.method == "POST":
|
|
|
126 |
|
127 |
@app.route("/logout")
|
128 |
def logout():
|
129 |
+
session.clear() # Clear session
|
130 |
+
session.modified = True # Explicitly mark session as modified
|
131 |
+
# Optionally, delete the session cookie explicitly
|
|
|
|
|
|
|
|
|
132 |
response = redirect("https://biryanihub-dev-ed.develop.my.salesforce-sites.com/PublicLogin")
|
133 |
+
response.delete_cookie('session') # Adjust this depending on the session cookie name
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
return response
|
135 |
|
136 |
+
|
137 |
@app.route("/signup", methods=["GET", "POST"])
|
138 |
def signup():
|
139 |
if request.method == "POST":
|