Solved

Find a cookie

Posted on 2001-08-13
7
276 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
7 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
Comment Utility
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
Comment Utility
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
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 5

Author Comment

by:KobiK
Comment Utility
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
Comment Utility
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
Comment Utility
>> 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
Comment Utility
Did you figure out how to do this?
dcass
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now