Home > Net >  Why the Session problem
Why the Session problem

Time:01-04

I
after a successful loginThe Session (" UserName ")=UserName;
Will put the name near the Session
Then I Redirect Response. Redirect ("/Home/Index ");
Because the Index has logon authentications,
If (filterContext. HttpContext. Session (" UserName ")==null | | filterContext. The HttpContext. Session (" UserName "). The ToString ()=="")
{
FilterContext. Result=new RedirectResult ("/Home/Login ");
}
This code was not passed, the second click just have value judgment in the Session, because of what causes, so to solve?
  •  Tags:  
  • C#
  • Related