David Ko commited on
Commit
d5410d2
ยท
1 Parent(s): 4ba39ac

Do not modify session in serve_index_html to avoid extending expiry; honor absolute 2-min expiry

Browse files
Files changed (1) hide show
  1. api.py +2 -4
api.py CHANGED
@@ -1270,10 +1270,8 @@ def serve_index_html():
1270
  # ์„ธ์…˜ ์ƒํƒœ ๋””๋ฒ„๊ทธ
1271
  print(f"Session data: user_id={session.get('user_id')}, username={session.get('username')}, is_permanent={session.get('permanent', False)}")
1272
 
1273
- # ์„ธ์…˜ ์œ ์ง€๋ฅผ ์œ„ํ•ด ์„ธ์…˜ ์—…๋ฐ์ดํŠธ
1274
- session['user_id'] = current_user.id
1275
- session['username'] = current_user.username
1276
- session.modified = True
1277
 
1278
  # index.html์„ ์ฝ์–ด ํ•˜ํŠธ๋น„ํŠธ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ฃผ์ž…
1279
  index_path = os.path.join(app.static_folder, 'index.html')
 
1270
  # ์„ธ์…˜ ์ƒํƒœ ๋””๋ฒ„๊ทธ
1271
  print(f"Session data: user_id={session.get('user_id')}, username={session.get('username')}, is_permanent={session.get('permanent', False)}")
1272
 
1273
+ # ์„ธ์…˜ ๋งŒ๋ฃŒ๋ฅผ ์˜๋„๋Œ€๋กœ ์œ ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ์—ฌ๊ธฐ์„œ ์„ธ์…˜์„ ๊ฐฑ์‹ ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
1274
+ # ์ฃผ์˜: ์„ธ์…˜์— ์“ฐ๊ธฐ(๋˜๋Š” session.modified=True)๋Š” Flask-Session์—์„œ ๋งŒ๋ฃŒ์‹œ๊ฐ„์„ ์—ฐ์žฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
 
 
1275
 
1276
  # index.html์„ ์ฝ์–ด ํ•˜ํŠธ๋น„ํŠธ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ฃผ์ž…
1277
  index_path = os.path.join(app.static_folder, 'index.html')