Which of following is the best approach to assign a session in MVC?

Q & AWhich of following is the best approach to assign a session in MVC?
Admin Staff asked 4 years ago

Which of following is the best approach to assign a session in MVC?

a.System.Web.HttpContext.Current.Session[“LoginID”] =7;
b.Current.Session[“LoginID”] =7;
c.Session[“LoginID”] =7;
d.None

1 Answers
Admin Staff answered 4 years ago

b.Current.Session[“LoginID”] =7;