I have a controller and two actions in it:
public ActionResult Index()
{
this.Session.Add("Boo", "Foo");
return View();
}
public ActionResult Details()
{
Debug.WriteLine(this.Session["Boo"]);
return View();
}
Then on the Index View I have a link
<div class="form-group">
@Html.ActionLink("Details", "details")
</div>
When Index
action is invoked I set session variable "Boo", then in the Index
View, I click on the Details link and when I get to Details action, Session ID is different from what it was in the Index action, and obviously this.Session["Boo"]
is null.
Any ideas why is it happening?
Thanks!