Relative Content

Tag Archive for pythonsessioncookiestokenretool

Best Practices on Cookies/Tokens/Session Id on web app

I am wokring on creating a user login in my app where after a period of time (expire), my app will logout on the client side. To do this and add security I was thinking of after login creating a user token in python (using the uuid module) and pass that token to the client side and use local storage to save that token and use it for all future web requests. To achieve this I am thinking of creating a table in my Database which stores the token for look up and it’s expiry date. Then all future web requests will pass the token and then if it is still valid complete the server request. For each successful request the expiry will get updated in the database. If the token has expired it will pass an error response and redirect the app to the login page.