Hello everyone.
How can I read a cookie file properly? I am trying to do a simple app to retrieve cookie information having a cookie file, but using a text editor, it shows the info coded...
Thanks in advance!
They are different formats for each browser. A quick search on Yahoo or Google might help.
Here is Opera's cookie file format:
http://www.opera.com/docs/fileformats/
Couldn't find anything quickly about the others.
I remember a "cookie manager application" written by sapero a few years ago.
The source of this application is somewhere in my archives.
If i ever manage to find it, i'll post it here.
I would thank you for that :)
Thanks for the answers too
Ok, found the cookie manager you spoke in old ibasic archive.
Thanks!
Joao, for IE cookies you can use InternetGetCookie function if you know the URL. You can also enumerate all stored cookies starting from FindFirstUrlCacheEntry.
$include "windowssdk.inc"
$include "wininet.inc" ' InternetGetCookie
$include "shlwapi.inc" ' UrlUnescape
string szCookie
cch = 256
result = InternetGetCookie("http://www.ionicwind.com/forums/", 0, szCookie, &cch)
select (result)
case 0
' optional - replace all %xx to characters
UrlUnescape(szCookie, szCookie, &cch, URL_UNESCAPE_INPLACE)
MessageBox 0, szCookie, ""
case ERROR_NO_MORE_ITEMS
MessageBox 0, "There is no cookie for the specified URL", ""
case ERROR_INSUFFICIENT_BUFFER
MessageBox 0, "The szCookie buffer is too small", "" ' cch = required size
endselect
Quote from: JoaoAfonso on December 11, 2008, 10:31:58 PM
Ok, found the cookie manager you spoke in old ibasic archive.
Thanks!
Yes, it's that one.
Anyway, just a note for those who may not know.
It's Ibstd code so it won't compile with Ebasic.
Try with Cbasic instead.
I gathered more or less all the files required to get the program compiled properly.
I may forgot one file or more as i did not try to compile the program.
I also included a compiled version of the program.
A version more recent than what you may have if you compile the current code.
Unfortunately, I do not have the source of that version.
See the zip attached to my post.