iloveny

Hi folks!

I am trying to create an application that will read all the cookies in a user's computer. After reading it, it will list all of the cookies in that machine. Users can then delete all of them or just delete what they want.

I am using VB.Net. I wonder if there is class library in .Net Framework 2.0 that I can use to read all the avaiable cookies in a specific machine

Many many thanks in advanced for the help and time!!!



Re: Windows Forms General Cookie Cleaner, a Window Form

nobugz

Try this:

string path = Environment.GetFolderPath(Environment.SpecialFolder.Cookies);
string[] names = System.IO.Directory.GetFiles(path, "*.txt");
foreach (string name in names) {
string[] cookie = System.IO.File.ReadAllLines(name);
listBox1.Items.Add(cookie[2]);
}







Re: Windows Forms General Cookie Cleaner, a Window Form

iloveny

Thanks nobugz!!

I noticed that Firefox and IE are NOT sharing their cookie information. I suppose the code that you wrote will only read cookie from IE. Is there anyway we can read cookie from Firefox as well

I also notice (this may be incorrect), that in IE 7, there is no Temporary Internet File where IE usually stores its cookies information.

Thanks for all the help and time!





Re: Windows Forms General Cookie Cleaner, a Window Form

nobugz

It is harder to find for Firefox. c:\documents and settings\user\application data\mozilla\firefox is the base folder. There's a profile.ini file with different users, you'll have to read that to find the users profile folder. Then find the cookies in profiles\xxxx.xxxx\cookies.txt.





Re: Windows Forms General Cookie Cleaner, a Window Form

iloveny

Hi, thanks nobugz!!

Now, I know why you said it's harder to find firefox's cookie. First, it's pretty hard to locate it. Secondly, the cookies.txt is not really user-friendly formatted text.

hmm....

anyways, thanks a lot!