Solved

Find a cookie

Posted on 2001-08-13
7
286 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
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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

785 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