【问题标题】:check which user session is expired asp.net [duplicate]检查哪个用户会话已过期 asp.net [重复]
【发布时间】:2017-02-23 13:30:14
【问题描述】:

检查会话到期。我在Global.asax.cs中使用以下代码

void Session_End(Object sender, EventArgs E)
{
    //get userId of the user whose session is expired!
}

有没有办法检查哪个用户会话过期了?

【问题讨论】:

标签: c# asp.net-mvc session


【解决方案1】:

Session_End 在会话结束时被调用 - X 没有。上次请求后的分钟数。

private void Session_End(object sender, EventArgs e)
{
    //This will run only when sessionstate mode is "InProc"    

    var Name= Session["UserName"];
    var Id= Session.SessionID;
}

【讨论】:

  • 抄袭抄袭!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-04-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-12
  • 2014-06-25
相关资源
最近更新 更多