Solved

Find a cookie

Posted on 2001-08-13
7
281 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

948 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

21 Experts available now in Live!

Get 1:1 Help Now