Hi there. I am a new asp.net coder so please help me if I am doing something wrong. We are trying to set up a simple cookie to record which server a user is at (in our server farm) so we can tell the load balancer program to keep the user on the same server throughout their session. (our load balancer has no session logic).
protected void Page_Load(object sender, EventArgs e)
if (Request.Cookies["serverID"] == null) //check if cookie exists
//if not, then grab server variable from web.config file
string serverName = System.Web.Configuration.WebConfigurationManager.AppSettings.Get("serverID");
//then set cookie
Response.Cookies["serverID"].Value = serverName;
This seems very simple, yet, it is not working. The only cookies being set are those by Google Analytics. What am I doing wrong?