I'm creating an ASP.NET Core MVC application and I want that on the Homepage the user will be required to enter his/her CNIC (Identity Card) number.
After that, he'll be able to navigate to any page on the application. But if he/she is idle for 5 minutes or more then after 5 minutes if he/she tries to perform any action means to try to go to any other page then he/she will be redirected to "Homepage" and is required to enter his/her CNIC number again.
How can I implement this functionality using Sessions in the an ASP.NET Core MVC application?
What I have tried:
I tried using sessions, but can't get the logic done