I have two separate websites. The main site requires a login. A menu on my website should redirect the user to a different website and pass to it the username of the logged in user. I have the following code:
Main website (sending):
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["user"] = Session["UserName"].ToString();
client.UploadValues("http://spsrv02:93/", values);
}
Other website (receiving):
string value = Request.Form["user"];
I am getting this error: "ERR_TOO_MANY_REDIRECTS"
Please help. What am I doing wrong?
P.S I don't want to go through URL parameters since I will have to encrypt/decrypt the data and I don't want to get into that whole cryptography deal.
I tried debuggin with VS but I can't redirect to a local running IIS page
http://spsrv02:93/
in the code above? Or when redirecting the user to "Site B" after the code above has executed? Or something else? In either case, if the code shown above is on "Site A" and you're having an issue with "Site B" then wouldn't you want to examine and debug that code, not this? It's not really clear what specific problem you're observing or what specific operation is failing.