WinHttpRequest and cookies problem

WinHttpRequest and cookies problem

am 09.01.2007 12:39:00 von MD Websunlimited

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

Re: WinHttpRequest and cookies problem

am 09.01.2007 13:00:30 von Anthony Jones

"Dan" wrote in message
news:eI$mIL%23MHHA.2140@TK2MSFTNGP03.phx.gbl...
> 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.

> Is this expected from WinHttp and how can I solve
> this problem?
>
> Thank you
> Dan
>
>

Re: WinHttpRequest and cookies problem

am 09.01.2007 13:39:27 von MD Websunlimited

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

Re: WinHttpRequest and cookies problem

am 09.01.2007 22:35:08 von Anthony Jones

"Dan" wrote in message
news:%23VUa6s%23MHHA.5016@TK2MSFTNGP04.phx.gbl...
> 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?

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.

>
> Thank you
>
>