public static bool TryParse(string input, out CookieHeaderValue parsedValue)
{
parsedValue = null;
if (!String.IsNullOrEmpty(input))
{
string[] segments = input.Split(segmentSeparator);
CookieHeaderValue instance = new CookieHeaderValue();
foreach (string segment in segments)
{
if (!ParseCookieSegment(instance, segment))
{
return false;
}
}
// If we didn't find any cookie state name/value pairs then cookie is not valid
if (instance.Cookies.Count == 0)
{
return false;
}
parsedValue = instance;
return true;
}
return false;
}