Get ASP.NET Session Last Access Time (or Time-to-Timeout)

后端 未结 4 565
天涯浪人
天涯浪人 2020-12-18 17:44

I\'m trying to determine how much time is left in a given ASP.NET session until it times out.

If there is no readily available time-to-timeout value, I could also ca

4条回答
  •  渐次进展
    2020-12-18 18:07

    You can get the timeout in minutes from:

    Session.Timeout
    

    Isn't this enough to provide the information, as the timeout is reset every request? Don't know how you want to display this without doing a request?

    Anyhow, best way is on every request setting some Session variable with the last access time. That should provide the info on remote.

提交回复
热议问题