Let's say I want to store a variable called language_id
in the session. I thought I might be able to do something like the following:
public class CountryController : Controller
{
[WebMethod(EnableSession = true)]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResultChangelangue(FormCollection form)
{
Session["current_language"] = form["languageid"];
return View();
}
}
But when I check the session it's always null. How come? Where can I find some information about handling session in ASP.NET MVC?