Spaces:
Running
Running
David Ko
commited on
Commit
ยท
ac9962b
1
Parent(s):
2937552
Enforce 2-minute session expiry: set PERMANENT_SESSION_LIFETIME=120s via timedelta and disable remember-login
Browse files
api.py
CHANGED
@@ -66,7 +66,6 @@ app.config['SESSION_TYPE'] = 'filesystem'
|
|
66 |
app.config['SESSION_PERMANENT'] = True
|
67 |
app.config['SESSION_USE_SIGNER'] = True
|
68 |
app.config['SESSION_FILE_DIR'] = session_dir
|
69 |
-
app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(days=7) # ์ธ์
์ ํจ ๊ธฐ๊ฐ ์ค์
|
70 |
print(f"Using session directory: {session_dir}")
|
71 |
Session(app)
|
72 |
|
@@ -1176,7 +1175,7 @@ def login():
|
|
1176 |
if username in users and users[username].password == password:
|
1177 |
# ๋ก๊ทธ์ธ ์ฑ๊ณต ์ ์ธ์
์ ์ฌ์ฉ์ ์ ๋ณด ์ ์ฅ
|
1178 |
user = users[username]
|
1179 |
-
login_user(user, remember=
|
1180 |
session['user_id'] = user.id
|
1181 |
session['username'] = username
|
1182 |
session.permanent = True
|
|
|
66 |
app.config['SESSION_PERMANENT'] = True
|
67 |
app.config['SESSION_USE_SIGNER'] = True
|
68 |
app.config['SESSION_FILE_DIR'] = session_dir
|
|
|
69 |
print(f"Using session directory: {session_dir}")
|
70 |
Session(app)
|
71 |
|
|
|
1175 |
if username in users and users[username].password == password:
|
1176 |
# ๋ก๊ทธ์ธ ์ฑ๊ณต ์ ์ธ์
์ ์ฌ์ฉ์ ์ ๋ณด ์ ์ฅ
|
1177 |
user = users[username]
|
1178 |
+
login_user(user, remember=False) # 2๋ถ ์ธ์
๋ง๋ฃ๋ฅผ ์ํด remember ๋นํ์ฑํ
|
1179 |
session['user_id'] = user.id
|
1180 |
session['username'] = username
|
1181 |
session.permanent = True
|