My issue lies with the functionality of CookieAuthenticationOptions.ExpireTimeSpan in setting the user session timespan. While it works effectively, it may be a bit too efficient. The problem arises when a user is working on filling out textboxes and other fields without any server activity happening. This results in the user being signed out when they click "Save," causing them to lose all the entered data.
Is there a way for me to update the timestamp continuously to prevent the session from expiring while the user is actively working on the page?
I have brainstormed some possible solutions:
- Implement JavaScript polling/pinging, but this might defeat the purpose of automatically signing out users after a period of inactivity.
- Create a script to trigger a ping to the server upon keypress events, although this could be challenging due to multiple forms being used.
- Possibly redirect the user back to the last form they were using to repost the data, if feasible.
It's worth mentioning that I am utilizing AngularJS 1.4.7 as my JavaScript framework.