Google을 검색하면 세션 만료가 프로그래밍 방식으로 감지되는 여러 가지 답변을 찾을 수 있습니다. 이것은 내가 모든 사람들이 내가 세션이 Context.Session가 null되지 않습니다 방법 다음 만료 위의 코드 1)에 몇 가지 질문이 그것을세션 만료를 프로그래밍 방식으로 감지하는 방법
global.asax
---------------
protected void Session_Start(object src, EventArgs e)
{
if (Context.Session != null && Context.Session.IsNewSession)
{
string sCookieHeader = Request.Headers["Cookie"];
if (null != sCookieHeader && sCookieHeader.IndexOf("ASP.NET_SessionId") >= 0)
Response.Redirect("/Session/Timeout");
}
}
를 사용 보았다 코드? 2)이 라인의 의미는 무엇입니까 Request.Headers["Cookie"];
좋은 토론을 원합니다. 세션이 Context.Session가 null되지 않습니다 방법 다음 만료되면 감사
on Session_Start, Session.IsNewSession은 항상 true입니다. 네가 잘못된 길로 가고 있다고 생각해서 너는 무엇을하려 하는가? –
세션 종료에 연결하려면이 것을 확인하십시오. http://stackoverflow.com/questions/621744/how-to-handle-session-end-in-global-asax –