[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

Find a cookie

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
KobiK
Asked:
KobiK
1 Solution
 
robert_marquardtCommented:
Maybe make the CD-ROM door open and have a look if it is there :-)

(Sorry could not resist)
0
 
KobiKAuthor Commented:
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
 
BryGuyCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
KobiKAuthor Commented:
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
 
BryGuyCommented:
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
 
KobiKAuthor Commented:
>> 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
 
dcassCommented:
Did you figure out how to do this?
dcass
0

Featured Post

Independent Software Vendors: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now