WinHttpRequest and cookies problem

D

Dan

Hello,

I have a simple ASP page that connects to another
server, requests a page, manipulate the results
and sends it to the client.
My problem starts when the remote server sets a
cookie with no path attribute and then redirect me
to another page. The redirection is done
automatically which is great for me but WinHttp
doesn't send the new cookie.
I discovered that WinHttp will only send that
cookie for the page it was set for. I thought no
path is like stating "path=/".
Is this expected from WinHttp and how can I solve
this problem?

Thank you
Dan
 
A

Anthony Jones

Dan said:
Hello,

I have a simple ASP page that connects to another
server, requests a page, manipulate the results
and sends it to the client.
My problem starts when the remote server sets a
cookie with no path attribute and then redirect me
to another page. The redirection is done
automatically which is great for me but WinHttp
doesn't send the new cookie.
I discovered that WinHttp will only send that
cookie for the page it was set for. I thought no
path is like stating "path=/".

Nope no path means the current page.
 
D

Dan

Thank you for your reply.
Nope no path means the current page.

Since it works differently for all browsers (they
do send the cookie), I suspect that it's a WinHttp
only "feature".
How can I solve my problem then? The remote site
expects to see this cookie
or it will not handle my request properly.
Does it mean that I have to manually add this
cookie to every request that follows the original
one?

Thank you
 
A

Anthony Jones

Dan said:
Thank you for your reply.


Since it works differently for all browsers (they
do send the cookie), I suspect that it's a WinHttp
only "feature".
How can I solve my problem then? The remote site
expects to see this cookie
or it will not handle my request properly.
Does it mean that I have to manually add this
cookie to every request that follows the original
one?

That's about the size of it, yes. WinHTTP does not track cookies. The only
time it will repeat a cookie is on a redirect to the same domain.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top