System.Net.CookieContainer.CookieContainer.RemoveOldest C# (CSharp) Method

RemoveOldest() public method

public RemoveOldest ( string domain ) : void
domain string
return void
		void RemoveOldest (string domain)
		{
			int n = 0;
			DateTime oldest = DateTime.MaxValue;
			for (int i = 0; i < cookies.Count; i++) {
				Cookie c = cookies [i];
				if ((c.TimeStamp < oldest) && ((domain == null) || (domain == c.Domain))) {
					oldest = c.TimeStamp;
					n = i;
				}
			}
			cookies.List.RemoveAt (n);
		}