Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read localhost cookie

Status
Not open for further replies.

spwhite

Programmer
May 21, 2003
5
0
0
GB
I am trying to read a cookie into VB6 that was saved by a page running under localhost, by using InternetGetCookie (wininet.dll).

I can successfully read any other cookies apart from ones saved under localhost.

The cookie file appears as white_s@~~local~~[2].txt and I just don't seem to be able to use the ~ tilde in the function to access the file.

I have tried many combinations of the URLName parameter -with and without tildes - but none have worked so far.

Any ideas?
 
Are you sure that the name is the problem. I tried it with your filename and I can open the archive. Test if you can open the archive with other programm (notepad).

peterguhl@yahoo.de
 
Yes it will open in notepad, etc.

I have a separate method to get to the data by going to the cookie folder (via registry) and manually reading the cookie file but I am trying to get InternetGetCookie to work in this app for this case.

This is the code that I am using:

Private Declare Function InternetGetCookie Lib "wininet.dll" _
Alias "InternetGetCookieA" _
(ByVal lpszUrlName As String, _
ByVal lpszCookieName As String, _
ByVal lpszCookieData As String, _
lpdwSize As Long) As Boolean

...

Result = InternetGetCookie(UrlName, CookieName, CookieText, 255)

It is the value for UrlName that seems to be giving me the problem.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top