Commit e6e2f325 e6e2f325ff72b6364e8f93aa9c92a209ee1786f0 by Christian Gerdes

Modified Extract Cookie to use the built in cookie parser instead.

1 parent bd414362
......@@ -130,26 +130,17 @@ namespace LIL_VSTT_Plugins
public override void Extract(object sender, ExtractionEventArgs e)
{
WebHeaderCollection col = e.Response.Headers;
foreach (string h in col.Keys)
foreach (Cookie ck in e.Response.Cookies)
{
if(h.Equals("Set-Cookie"))
if(ck.Name.Equals(cookieName))
{
string[] cookie = col[h].Split('=');
if(cookie[0].Equals(cookieName))
{
string value = "";
if (cookie.Length > 1)
{
value = cookie[1].Split(';')[0];
}
e.WebTest.Context.Add(this.ContextParameterName, WebUtility.UrlDecode(value));
e.Success = true;
e.Message = "Cookie found";
return;
}
e.WebTest.Context.Add(this.ContextParameterName, WebUtility.UrlDecode(ck.Value));
e.Success = true;
e.Message = "Cookie found";
return;
}
}
e.Success = false;
e.Message = "Cookie not found";
}
......