title: Set session in ASP.Net MVC Controller from another class
body: <p>I'm trying to access a method of my MVC HomeController from another controller to redirect the user to the homepage if he is not authenticated. The problem is that the Session in my HomeController is not setted if I instantiate it on my own, but I have to access a variable stored in the session from my HomeController. I tried to solve the problem this way:</p>
  
  <pre><code>HomeController currentHomeController = new HomeController();
  currentHomeController.Session = this.Session;
  return currentHomeController.Index();
  </code></pre>
  
  <p>But the Session variable has no setter so this does not work. Is there a different way to do this?</p>
  
  <p><strong>My Solution</strong></p>
  
  <p>This works:</p>
  
  <pre><code> return RedirectToAction("Index", "Home");
  </code></pre>
  
  <p>Thanks for your answers!</p>