title: Which is better, Session or 2 TempData in ASP.NET MVC?
body: <p>I found that I shouldn't use <code>Session</code> a lot in ASP MVC <a href="https://stackoverflow.com/questions/5220980/is-it-a-good-practice-to-avoid-using-session-state-in-asp-net-mvc-if-yes-why-a">here</a>, <a href="https://stackoverflow.com/questions/22055631/why-should-i-move-away-form-using-httpcontext-session-state-in-my-asp-net-mvc-a?lq=1">here</a> and in other places.</p>
  
  <p>So, I want to know if it's better to use <code>TempData</code> like I did below or not.</p>
  
  <pre><code>public ActionResult Action1()
  {
    if (SomeCondition)
    {
       /*
         I want to show alert to user based on this value that should appear in Action2 view
         So, is it better to:
         1. Session["user"] = "something";
         2. TempData["user"] = "something";
       */
       return RedirectToAction("Action2");
    }
       return View();
  }
  
  public ActionResult Action2()
  {
     /*
        1. I can read Session["user"] in the view
        2. TempData["user"] = TempData["user"].ToString();
           Now I can read TempData in the view
     */
     return View();
  }
  </code></pre>