This is really weird – I’ve got a MVC app running, including a Login method in my ServicesController class:
public ActionResult Login() {
var p = Request.Params;
var userName = p["username"];
var password = p["password"];
// etc...
}
The weird thing is that when I call the service with the request:
/services/login?username=myusername&password=password
I get into the code and find that userName is “anotherusername,myusername”. Depending on what browser I’m using, I get different values in place of “anotherusername”, which I recognize from some other apps I’m developing. So is “username” some kind of reserved word that one shouldn’t use as a parameter name? What other reserved words are there that cannot be used safely as parameters?
Request.Paramscombines values fromRequest.QueryString,Request.Form,Request.ServerVariablesandRequest.Cookies. I would expect that the second value is either a server variable or a cookie. You could find out by checking each collection for your request.Try checking the
Request.QueryString(GET request) orRequest.Form(POST request) instead.