This is a simple Flask web application that demonstrates user session management using Redis as the session storage. It allows users to log in, manage a shopping cart, and tracks their visits. The application is designed to showcase how to handle user sessions, maintain user data, and implement secure session management.
Before running the application, ensure you have the following prerequisites installed:
- Clone the repository:
git clone https://github.com/aws-samples/amazon-elasticache-samples.git
cd webinars/flask-redis-session
- Install the requirements
pip install requirements.txt
- Set the application variable
export FLASK_APP=sessionstore.py
export SECRET_KEY=test
export REDIS_URL=test1.XXXXXX.clustercfg.use1.cache.amazonaws.com
- Installation and Usage
flask run -h 0.0.0.0 -p 5000 --reload
Access application using browser
Reload the browser to see updated visits count
Access from a differrent browser with same userid to see the session data retrieved and count updated
For all logged out users keep track of with with /expired_users