"Joerg Jooss" <news-> wrote in message
news

...
> Andy Fish wrote:
>
> [...]
>> well thanks for the explanation. Unfortunately I still have the
>> problem of how to construct a new HttpWebRequest that contains the
>> same cookies as the current HttpRequest.
>>
>> FWIW my solution was to bypass the cookie mechanisms on both sides:
>>
>> newHttpWebRequest.Headers["Cookie"] = Request.Headers["Cookie"];
>>
>> n.b. this will only work if newHttpWebRequest.CookieContainer is null.
>
> Seems I missed the fact that you're mixing System.Net and System.Web
> stuff here. Yes, doing this is a pain. If you want to work with objects
> here, you have to create System.Net.Cookies from System.Web.HttpCookies.
>
Funnily after I got that working, I ran into all sorts of problems with
trying to "loop back" from within a web page to invoke another web page on
the same server using the same cookies. Sometimes I would get the "Access
Forbidden: Too many users are connected" message but mostly IIS would just
lock up and I would have to do an iisreset to get it back.
In the end I had to abandon this approach entirely. Maybe it would work on a
server OS but not on my XP pro
> Cheers,
> --
> http://www.joergjooss.de
> mailto:news-