public static string LoginAttempt(string username, string pw) { APICalls api = new APICalls(); string res = api.LoginAttempt(username, pw).Result.Trim('\\').Trim('"'); var values = res.Split(';'); if (values[0] == "1") { HttpContext.Current.Session["idUser"] = values[1]; HttpContext.Current.Session["username"] = values[2]; HttpContext.Current.Session["name"] = values[3]; HttpContext.Current.Session["lastName"] = values[4]; //HttpContext.Current.Response.Redirect("~"); } return(values[0]); }