My .NET MVC3 website is being loaded through an iframe on the parent website. They GET a controller's action on my website with certain parameters in the query string. My action validates these parameters, stores them in session and does RedirectToAction() to a different controller's action. In the second action, the first line of code gets these parameters from session. We did not have any problems in DEV, moreover we did not have any problems in QA.
In Production, after the redirect, the session variable gets cleared. This only happens in IE 8 and 7. The Production server does have a load balancer, but at the moment the second server is turned off and the problem is still there. Here is the code, I stripped out validation and some other stuff.
//Here is where they come in
[HttpGet]
public ActionResult Index(string locationGUID, string OtherParam)
{
//?locationGUID=ABCDEFGHIJKLMNOP,XXXXXXXXX&ContractInstance=2111,#####
//some validation here
var passedData = new PassedData
{
Guids = locationGUID.Split(',').ToList(),
OtherParam = OtherParam
};
PassedData = passedData;
//more validation and init DB logging here
return RedirectToAction("Index", "OtherController");
}
//PassedData is a property of Base Controller, from which all other controllers inherit
public PassedData PassedData
{
get { return (PassedData)Session["PassedData"]; }
set { Session["PassedData"] = value; }
}
//Here is Index of "OtherController", when we get here in Prod in IE, first line throws null reference exception, because PassedData is now NULL....
[HttpGet]
public ActionResult Index()
{
ViewBag.CustInfoList = PassedData.Guids.Select(guid => GetCustomerInfo(guid).Data).ToList();
//the rest of the code is not relevant to this question, since PassedData is already NULL :(
}
Thank you very much in advance!
UPDATE: I implemented session state mode "StateServer". Nothing changed.
UPDATE: I'm looking at Fiddler. IE: The parent site sets session cookie. My site doesn't. FF: Both sites set session cookie.