Solved

Find a cookie

Posted on 2001-08-13
7
298 Views
Last Modified: 2010-04-06
I need a GOOD method to find a cookie on the local client machine, from my delphi application (runs on the same machine).

my application should be able to find that cookie both on IE and Netscape (Win9x/2000)

Basicaly i can search C:\WINDOWS\Cookies (for IE) but what i'm looking for is maybe some kind of API that will locate that cookie (given server-name + cookie-name) in IE + Netscape (other browsers welcome).

This should be very fast and as accurate as possible.
Any smart ideas?
0
Comment
Question by:KobiK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6380987
Maybe make the CD-ROM door open and have a look if it is there :-)

(Sorry could not resist)
0
 
LVL 5

Author Comment

by:KobiK
ID: 6381115
robert,
what's funny here?

I have a situation that requires me to check for _my_ server's cookie on the client machine.
We have an affiliation/referral programs with 3d party companies (referrals):
3d party company place a link on their site:
http://www.my-product-site.com?refid=1234

some user surfs to the "referral" site,
user clicks that link (on the referral site),
user is now at my-product-site.com, receives a cookie (refid=1234), and
downloads my program.

in the setup process my setup program needs to check who was the original referral (i.e.: 1234) by checking if the client has that cookie on his machine.

simple.
0
 

Accepted Solution

by:
BryGuy earned 200 total points
ID: 6381865
For IE, look up InternetGetCookie.  For Netscape, there really isnt much help out there, but the cookies.txt is easy to understand and parse.

For Opera, they have some specs on thier site about the format... it's kinda weird.

Bryan Ashby
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Author Comment

by:KobiK
ID: 6400477
Thanks BryGuy.
InternetGetCookie works greate with IE.
Any "logical" way to do it with Netscape?
I was unable to find a correct (generic) algorithm.
0
 

Expert Comment

by:BryGuy
ID: 6410273
For Netscape, you have to locate the COOKIES.TXT - for everything before 6, this is very easy... 6/Mozilla arent that bad either I suppose... anyway... You then have to parse it.  I just read it in as a text file one line at a time, then use some tokens to break up the strings into their "parts" - each line is a cookie in the COOKIES.TXT unless it starts with a comment marker #.

Take a look at COOKIES.TXT in notepad/edit and you will see how easy its going to be.  The date/times are in UNIX format.

Hope that helps a bit,

Bryan Ashby
0
 
LVL 5

Author Comment

by:KobiK
ID: 6415532
>> you have to locate the COOKIES.TXT
That is the problem...
I cant seem to find a logical way to find it.
Thanks for your help.
0
 

Expert Comment

by:dcass
ID: 13530184
Did you figure out how to do this?
dcass
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question