Denis Co
InternetGetCookie[Ex], InternetSetCookie[Ex], FindFirstUrlCacheEntry[Ex]
et al
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
I just did the code Which consist of an enumeration and retreival,
But InternetGetCookie does not seems to work.
The enumeration (FindFirstUrlCacheEntry) works though.
Perhaps, I do not understand how to use it properly?
I had a GetLastError of (998) ERROR_NOACCESS
Any help or sample code of usage would be greatly appreciated.
Thanks.
Denis
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:OQdD0QS...@TK2MSFTNGP03.phx.gbl...
ERROR_NOACCESS means you are passing a NULL or invalid pointer. Show how
you call InternetGetCookie
I do not know what to put as Name?
Denis
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:e%23KfJmas...@TK2MSFTNGP05.phx.gbl...
How is Buffer declared? If you have to cast, you probably got it wrong.
> I do not know what to put as Name?
You mean the second parameter? The documentation says "Not implemented",
so any value should do. NULL is perfectly fine.
I just changed &Buffer to Buffer but it is still the same...
Buffer is define as this:
BYTE Buffer [(64 * KB)];
???
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:uTSij2bs...@TK2MSFTNGP04.phx.gbl...
Do you initialize CookieSize to the length of the buffer before calling
the function?
Note that the size should be in TCHARs, not in BYTEs. TCHAR may be 1 or
2 bytes depending on whether you build ANSI or Unicode build.
This time I had an error of 12006 which is not define in error lookup.
I even try to place the call at the begening of the software...
Not working ...
Hummm! What do you think?
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:uZMqJJcs...@TK2MSFTNGP02.phx.gbl...
That would be ERROR_INTERNET_UNRECOGNIZED_SCHEME. You are passing
"my.yahoo.com" as the first parameter - make it "http://my.yahoo.com"
It worked finally.
Thank you very much.
On a side subject:
I need to stores/retrieves cookies independently of the user name created in windows.
Example: Let say I create the user 00001 and saves its cookies.
Then later I would call that user 00002 and restore it's cookies from 00001 for example.
In your opinion would my strategy old ?
Regards,
Denis
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:ur$xH6csG...@TK2MSFTNGP03.phx.gbl...
InternetGetCookie, InternetSetCookie et al use the cookie store of
whatever user account your process is running under. So you can
impersonate one user, read all her cookies and store them somewhere,
then impersonate another user and set cookies on her behalf.
Your help was most grateful.
Denis
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:%23r7fazl...@TK2MSFTNGP04.phx.gbl...
On yahoo, I setup a personal page and normally it recognizes me.
When I use those routines it does not?
Plus I can see the cookies in the cookies folder. When I use the routine it does not?
Thanks,
Denis
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:%23r7fazl...@TK2MSFTNGP04.phx.gbl...
Do you set persistent cookies? That is, does the cookie value passed to
InternetSetCookie[Ex] have expires= clause? Without such a clause, you
are setting a session cookie - temporary in-memory cookie that is only
active within your process. For an example, see
http://msdn.microsoft.com/library/en-us/wininet/wininet/managing_cookies.asp
I am guessing That I have to add a line saying for how long from FindFirstUrlCacheEntry().
in the structure INTERNET_CACHE_ENTRY_INFO
Is this right?
And Is this the only thing I am going to need?
Thanks,
Denis
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:Op6lVcNt...@TK2MSFTNGP03.phx.gbl...
Right. You can use InternetTimeFromSystemTime to format the time string.
> And Is this the only thing I am going to need?
I believe so.
Denis
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:uJs3cIOt...@TK2MSFTNGP03.phx.gbl...
Right now I am truncanating the user name@ and replace it by "http://"
Is there any cases where that should be "https://" if yes how would I know?
Regards,
Denis
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:uJs3cIOt...@TK2MSFTNGP03.phx.gbl...
By default, a cookie for a particular domain is sent to both HTTP and
HTTPS URLs in this domain. There exists a concept of secure cookie (one
that should only be sent over HTTPS): to set one, you append ";secure"
to the cookie data when calling InternetSetCookie. But I don't know how
to determine whether a particular cookie found in the cache is secure.
When I do:
Copy all files after log off, and recreate the user in another system restoring all files including index.dat.
It works.
When I try through those functions it does not restore properly.
I must be missing something?
Regards,
Denis
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:uJs3cIOt...@TK2MSFTNGP03.phx.gbl...
in my trial code I realize InternetSetCookie changed the data (don't know why).
Regards,
Denis
"Igor Tandetnik" <itand...@mvps.org> wrote in message news:OA%23u6hZt...@TK2MSFTNGP03.phx.gbl...
I want to edit the expire time, domain and other properties of the cookie.
What function can be used?
Thanks in advance.
Best regards,
Manjeet Dahiya
"Denis @ TheOffice" <den...@ica.net> wrote in message
news:11544574...@www.vif.com...
You can't edit a cookie; you can delete an old one and create a new one
with desired parameters. InternetGetCookie[Ex], InternetSetCookie[Ex]