title: Session parameter is empty ASP.NET MVC
body: <p>I am trying to write a "contact us" page, which displays some of the data entered by the user from the login page (contact page requires login). To do that I am using a session variable:
  code from login:</p>
  
  <pre><code>Session["User"] = account.Email;
  Session["Password"] = account.Password;
  Session["Name"] = account.Name;
  return Redirect("/Contact/contact");
  </code></pre>
  
  <p>Code from Contact controller:</p>
  
  <pre><code>public ActionResult Contact()
          {
              // if session user is null (e.i. user has not been logged in) redirects user to login page
              if (Session["User"]==null)
              {
                  return Redirect("/Login/login");
              }
  
              string name = Session["Name"] as string;
              string email = Session["User"] as string;
  
              Account acc = new Account(name, email);
  
              return View("contact", acc); // else returns contact html page
          }
  </code></pre>
  
  <p>Here is how info is supposed to be displayed:</p>
  
  <pre><code>@model Final_Project.Models.Account
  &lt;p&gt;&lt;span&gt;Name&lt;/span&gt;&lt;input class="contact" type="text" name="your_email" value="@Model.Name" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;span&gt;Email Address&lt;/span&gt;&lt;input class="contact" type="text" name="your_email" value="@Model.Email" /&gt;&lt;/p&gt;
  </code></pre>
  
  <p>But the text boxes display nothing. Since contact page is displayed, Session variable cannot be null (as in that case if statement would execute from controller, redirecting user back to login page). How can I access "Name" and "Email" strings from Session?</p>
  
  <p>EDIT:
  Apparently the problems were with the way I passed values to the model itself. Session variable had nothing to do with my issue</p>