internal string GetString() { bool first = true; if (_tokenizer.Eof) { return null; } do { _tokenizer.Next(first, true); first = false; } while (!_tokenizer.Eof && !_tokenizer.EndOfCookie); return _tokenizer.GetCookieString(); }
internal static IEnumerable<string> GetCookiesFromHeader(string setCookieHeader) { List<string> cookieStrings = new List<string>(); try { CookieParser parser = new CookieParser(setCookieHeader); string cookieString; while ((cookieString = parser.GetString()) != null) { cookieStrings.Add(cookieString); } } catch (InternalCookieException) { // TODO: We should log this. But there isn't much we can do about it other // than to drop the rest of the cookies. } return cookieStrings; }