Unable to logout from ASP.NET MVC application using FormsAuthentication.SignOut()

前端 未结 4 1473
心在旅途
心在旅途 2021-01-14 02:56

I am trying to implement Logout Functionality in ASP.NET MVC.

I use Forms Authentication for my project.

This is my Logout code:

FormsAuthen         


        
4条回答
  •  隐瞒了意图╮
    2021-01-14 03:43

    This method works, if you do not disable[comment] the following tags in the web.config file to test your web application easily.

    public ActionResult SignOut()
    {
        FormsAuthentication.SignOut();
        return RedirectToAction("Index", "Home");
    }
    

    web.config

    
      
    
    
    
      
        
          
          
        
      
    
    
    
      
        
          
        
      
    
    

提交回复
热议问题