Storing state in-memory is usually not a good idea for web apps, most use databases with persistence. I got curious and found the example code for implementing password-based authentication on SQLite. I don't think it's very compelling when the alternatives include Django.