Software Development Network>> Visual C#>> Clearing Cookies
I found this article:
http://support.microsoft.com/default.aspx/kb/326201/EN-US/
But I just don't know how to selectively clear cookies only, or selectively clear the cache of a single domain. Any help would be greatly appreciated.
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); }
Clearing Cookies
Uros Goljat
Alex Mendez
I found this article:
http://support.microsoft.com/default.aspx/kb/326201/EN-US/
But I just don't know how to selectively clear cookies only, or selectively clear the cache of a single domain. Any help would be greatly appreciated.
JimPDX
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);
}
CVGMERE
Use InternetSetCookie with a expires date that is in the past to remove it.
A lillte resource page: Managing Cookies.
Arul Livingston
You can do this with the methods i supplied in my last post.