private static string getLocation(WebHeaderCollection headers) { string location = ""; for (int i = 0; i < headers.Count; i++) { string header = headers.GetKey(i); if (header.Equals("Location")) { foreach (string value in headers.GetValues(i)) { location = value; } } } CookieFiap = new CookieFiap() { Location = location }; return(location); }
private static void getCookies(CookieCollection cookies) { foreach (Cookie c in cookies) { if (c.Name.Equals("ASP.NET_SessionId")) { CookieFiap.ASPNET_SessionId = c.Value; } else if (c.Name.Equals("jwt")) { CookieFiap.Jwt = c.Value; } else if (c.Name.Equals("ultimoUsuarioFIAP")) { CookieFiap.UltimoUsuarioFIAP = c.Value; } else if (c.Name.Contains("ASPSESSIONID")) { CookieFiap.ASPSESSIONID = c.Value; } } CookieFiapJson = CookieFiap.ToJson(); }