title: Sessions not being saved when when being created with .Net Core
body: <p>I am new to .Net and I am building a web application where I want to create a session when a user logs in or registers and confirms registration.  For logging in I have a razor page: Login where it simply prompts the user for their Username and Password which should be in my sql server and validated.  Once it checks that the valid user flag is correct I want to create the session and send the user to Index for now.  Then in Index I want to see if the session has been created and I want to read the value within the session and display it onto the Index view to confirm that the user info has been captured.<br>
  My Login.cs file looks like this: </p>
  
  <pre><code> public ActionResult OnPost(string UserName, string Password)
          {
  
              if (!ModelState.IsValid)
              {
                  return Page();
              }
  
              if(accountService.ValidateUserLogin(UserName, Password) == 1)
              {
  
                  string Email = accountService.UsernameGetEmail(UserName);
                  HttpContext.Session.SetString(Email, TempData["email"].ToString());
                  return RedirectToPage("/Index");
              }
              else
              {
                  //report error to user
                  return Page();
              }
          }
  </code></pre>
  
  <p>This is where I try to capture the session info in my Index.cs page:</p>
  
  <pre><code>public void OnGet()
          {
              if (HttpContext.Session.Id != null)
              {
                  SessionEmail = HttpContext.Session.GetString("Email");
                  ViewData["SessionEmail"] = SessionEmail;
              }
          }
  </code></pre>
  
  <p>This is the piece of html where I try to display that SessionEmail onto the view but it is null upon initialization of SessionEmail inside the index.cs file.</p>
  
  <pre><code>&lt;div&gt;
      @{ 
          if( ViewData["SessionEmail"] != null)
          {
          &lt;p&gt; Hello! @ViewData["SessionEmail"].ToString() &lt;/p&gt;
          }
      }
  &lt;/div&gt;
  </code></pre>
  
  <p>Hopefully you can point out my mistakes here and how I try to set up a session. After I am able to set up a session I am going to edit my layout's navbar so that it will change if a user is signed in or not so maybe if you can point out how I can go about this with sessions that would be great, perhaps: httpcontext.session.IsAvailable? Also, I do have addSession and useSession in my startup as well.</p>