How to use Session thru Login, Authorization,Authentication?
up vote 0 down vote favorite First of all i am a newbie when it comes to programming and i am only self-learning and would like to ask for solutions that i have encountered and can't be solved by my own I Can't make it work. i would like Session["userlevel"] == "Admin" to be the only one to access the view how can i make this to work please help.. public ActionResult Authorize(Test user) { using (TableEntities db = new TableEntities()) { var loginUserAdmin = db.Employees.Where(x => x.Username == user.Username && x.UserPassword == user.UserPassword && x.AccountStatus == "Active" && x.AccountType == "Admin").FirstOrDefault(); if (loginUserAdmin == null || loginUserAdmin != loginUserAdmin) else ViewBag.Messageko = "Admin"; Session["userid"] = loginUserAdmin.EmployeeID; Session["firstName"] = loginUserAdmin.FirstName; Session["lastName"] = loginUserAdmi