Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app: session expiration - redirect to index when session expires
Previous logic when sessions expire on /generate: 1. On /generate page, codename is added to the session. 2. When expiration occurs, session is cleared. 3. A flashed message indicating that the session has expired would be added to the current session (this is done via passing `_flashes` on the session object [0]). 4. Execution enters the view function associated with `/create`. But `/create` expects codename to be in the session (which was cleared in step 2), thus a KeyError will occur. Logic now when sessions expire on /generate: 1. On /generate page, codename is added to the session 2. When expiration occurs, session is cleared and user is redirected to the index. [0] https://github.com/pallets/flask/blob/cd4023d9d2ab630ce4f95856f065072ef8badb2b/flask/helpers.py#L449
- Loading branch information