solventum-image-metadata/templates
SamoilenkoVadym 0b136bac6c Fix session expiration issues and improve error handling
Fixed two critical session-related issues:

1. Session expiration during file processing
   - Added proper error message when session expires mid-process
   - Prevents silent failure and missing download buttons
   - Shows clear "Session expired" message to user

2. Session lifetime and cookie configuration
   - Increased session lifetime from 24 hours to 7 days (configurable)
   - Made sessions permanent (session.permanent = True) in all login flows
   - Improved cookie security settings with environment variable control
   - Added SESSION_COOKIE_SECURE and SESSION_LIFETIME_DAYS env vars
   - Fixed cookie configuration for HTTPS reverse proxy

Changes:
- web_app.py: Enhanced session configuration and made sessions permanent
- templates/index.html: Better error handling for session expiration

This fixes:
- "Unexpected token '<'" errors appearing intermittently
- Missing download buttons after metadata update
- Sessions expiring too quickly requiring frequent re-login

Environment variables (optional):
- SESSION_COOKIE_SECURE=true (default for HTTPS)
- SESSION_LIFETIME_DAYS=7 (default 7 days)

Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
2026-02-09 11:46:51 +00:00
..
index.html Fix session expiration issues and improve error handling 2026-02-09 11:46:51 +00:00
login.html Handle redirect on login page and clear stuck MSAL state 2026-02-06 23:55:12 +00:00
oauth_callback.html Fix MSAL initialization and interaction_in_progress error 2026-02-06 23:53:00 +00:00