Jan 20, 2016 04:16 PM|dbrosnan|LINK
I have been googling this but cannot find exactly what i am looking for. I have an MVC application with a sql server database. When a user logs in i set a session as follows
Session["UserId"] = UserId
My users tend to work on multiple tabs at the same time under the same login. That is fine. What i want to do, is using an ajax request from the browser i want to check how long is left before the session state expires. My ajax request will poll the server
every 1 minute, and I know my session state expires after 20 minutes, so after 18 minutes, the ajax request should return 2 minutes left, and after 19 minutes it should return 1 minute left, and after 20 minutes it should return 0.
My problem is, when i make the first ajax request to the server, it actually extends the session state by another 20 minutes. So every ajax call results in the extension of the session by 20 minutes more.
So I would like the c# code to check how long is left in the session, without actually extending the session.
local computer will not work for me because of people working in multiple tabs.
I appreciate any help being given.