Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cookies with wininet - a couple of simple questions

11 views
Skip to first unread message

Joe

unread,
Sep 27, 2005, 8:45:43 PM9/27/05
to
First apologies for cross posting but the Wininet groups are pretty dead.

Would someone tell me how cookies are handled in wininet - I can't work out
whether I need to add the cookies to any GET or POST I send or whether they
are added automatically.

I log in to a site with HttpOpenRequest then HttpSendRequest.

The login seems to work fine and I receive some cookies back in the header.
I then execute an InternetGetCookie "for fun" and I get the "logged in"
session ID cookies and some persistent cookies back.

What do I do with them? I cant work out whether they are handled
"automatically" by wininet

In other words, if I send subsequest Http Requests - either GETs or POSTs,
are the cookies appended automatically to the message or do I have to
manually append them in some way?

If I look at the cookies on my disk I see that some have been added with no
explicit action from my program - just accessing the site.

In fact I'm not that clear on the difference between InternetGetCookie() and
InternetSetCookie().

If InternetGetCookie gets the cookies from the server, and Wininet stores
them automatically on my machine, whats InternetSetCookie for?

Thanks in advance for any help.

and receive some session and persistent cookies. I dop a double check with


Joe

unread,
Sep 28, 2005, 6:51:58 AM9/28/05
to

"Joe" <n...@home.com> wrote in message
news:lvednSF8FoM...@pipex.net...

> First apologies for cross posting but the Wininet groups are pretty dead.
>
> Would someone tell me how cookies are handled in wininet - I can't work
out
> whether I need to add the cookies to any GET or POST I send or whether
they
> are added automatically.
>
> I log in to a site with HttpOpenRequest then HttpSendRequest.
>
> The login seems to work fine and I receive some cookies back in the
header.
> I then execute an InternetGetCookie "for fun" and I get the "logged in"
> session ID cookies and some persistent cookies back.
>
> What do I do with them? I cant work out whether they are handled
> "automatically" by wininet


Yes, it appears they are by default.


0 new messages