I use the CookieAuthenticationOptions.ExpireTimeSpan to set the timespan for the user session. And it works fine - maybee too good. When the user works by filling out textboxes etc., there is no server activity, which causes that when the user press Save, he is being signed out - and looses all entered data.
Is there any way where I can update timestamp, to prevent time expires when the user works without postback?
I have some ideas:
I am using AngularJS 1.4.7 as JavaScript framework.
Why not use a preprocessor directive to set an alternate expiration time if the solution is in debug mode?
var options = new CookieAuthenticationOptions {
#if DEBUG
ExpireTimeSpan = System.Timespan.FromDays(1)
#else
ExpireTimespan = System.Timespan.FromMinutes(20) //or your preferred timespan
#endif
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With