- Session concept is similar to Cookie. The Session data is stored on Client.
- It is defined as the duration for which a user logs into the server and logs out.
- The data is used to track this session which is stored into the temporary dictionary on the server.
- A session with each client is assigned a Session ID.
- For encryption, a Flask application needs a defined SECRET_KEY.
- pop() method - Used to remove the session variable.
Login Application in the flask using Session
- This is a simple login application built using python flask that implements the session.
- We will create a login application in the flask.
- If we visit the login page then, the application shows the login page. The user enter the data email Id and password
- Click the submit button. The user redirected to the success.html as given in the following image.
- Now, visit the profile page. It will display the message with the session name as the session variable 'email' is set to its value.
- As we now logged in to the application. This application make easy to log out the session, for this purpose, go back to the home page click on the logout button. It will destroy all the session variables set for this particular server.
If you want to learn about Python Course , you can refer the following links Python Training in Chennai , Machine Learning Training in Chennai , Data Science Training in Chennai , Artificial Intelligence Training in Chennai