0

I am trying to store a logged in user's information in a Session. However it does not seem to be working in my application. I keep getting the errors "The name 'Session' does not exist in the current context"

  [HttpPost]
    public ActionResult userLogin(User user)
    {
        using (TheDbContext db = new TheDbContext())
        {
            var usr = db.userAccount.Single(u => u.Email == user.Email && u.Password == user.Password);

            if (usr != null)
            {

                Session["UserID"] = usr.ID.ToString();
                Session["Email"] = usr.Email.ToString();

                return RedirectToAction("LoggedIn");
            }

        }
            return View();
    }
Kalvinl8
  • 35
  • 1
  • 7

0 Answers0