Reputation: 7897
I would like to know if the following is possible:
As part of the PageLoad of an ASP.Net page request:
If the above is possible, then, is there also a way to transfer the authentication cookie from the HttpWebResponse to the requesting browser? My gut feeling is probably not - but if this is the case, then how do proxy servers handle such things? Is that not essentially what they are doing?
Thanks for any help
Upvotes: 1
Views: 1855
Reputation: 69262
You can add a CookieContainer to the HttpWebRequest. It will store any cookies received from the response and if you attach the same cookie container to the next request, it will send those cookies back up to the server.
You can access the contents of this CookieContainer object and send those back to your client using Response.Cookies.
Upvotes: 1