Updated to use the latest versions of Flask and related modules.
Updated to use in-memory storage of session data and modern CSRF protection.