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.
I am not sure what to call this token. Is it a cookie? A session Id? or just a token. I am using ReTool on the front end.
Am on the right track to create secure web requests and timeout after a certain period of time?