I\'m not sure I\'m handling this the right way, but since I\'m running into issues, I assume I\'m not.
I have to have a corporation id sent in when loading the login scr
You need to create a separate cookie that identifies the Corporate ID that doesn't expire with user's session. Session["CorpId"]
will expire with the user session and won't work.
var corpCookie = new HttpCookie("CorpID", id);
corpCookie.Expires = DateTime.Now.AddDays(30.0);
HttpContext.Current.Response.Cookies.Set(corpCookie);
Each time the user logs in, you could update the expiry to make it a sliding expiration. To retrieve the cookie value, use the following:
var corpID = HttpContext.Current.Request.Cookies.Get("CorpID").Value;