I searched but I dont`t find any specific answer for this question. How I can get value in server how much time left, before session expires? My session settings:
//timeout for example 10 min.
<authentication mode="Forms"> <forms name=".ASPXAUTH_External" loginUrl="Authentication/Unauthorized.aspx" protection="All" timeout="10" path="/" slidingExpiration="true" defaultUrl="~/Pages/home.aspx" cookieless="UseDeviceProfile" enableCrossAppRedirects="false"/>
</authentication>
<sessionState mode="InProc" timeout="10">
</sessionState>
I get initial value (it will get 10*60 = 600 seconds):
SessionStateSection sessionSection = (SessionStateSection)WebConfigurationManager.GetSection("system.web/sessionState");
countdown.Text = sessionSection.Timeout.TotalSeconds.ToString();
But when session time left less then half and user do some action. I get initial value 600, but it is not equal for left session time, because "slidingExpiration" add some time (I don`t know how much), but not resets session left time to starting 10 min point.
How can I get remaining session time until expiration?