When I specify null or an empty set for the url, I don't seem to get any cookies let alone all of them. This is the code I'm using:
public static void clearCookies() { string szURL = ""; int dwSize = 256; StringBuilder lpszData = new StringBuilder(dwSize);
if (!InternetGetCookie(szURL, null, lpszData, ref dwSize)) { if (dwSize < 0) return; lpszData = new StringBuilder(dwSize); InternetGetCookie(szURL, null, lpszData, ref dwSize); }
MessageBox.Show("Cookie: " + lpszData); } |