>I've had a hunch that the Response object was a server object. The question becomes where would I put the cookie container? The app is an MDI app, and I'm using the Parent Form to hold a few properties that need to stay available throughout the course of the execution - could I stash the cookie container there, as a property? For that matter, after I've created the cookie container (and the cookie), could I force another request to get the server to recognize the new cookie?
>
>Perhaps dumb questions, but these are new waters for me. TIA...
Yes, once the cookie container is establish, it means that all incoming cookies from the server will live. In the way I use it, where I sent a call to a Login() method at first, receives a confirmation that includes the cookie, it means that all upcoming requests will transmit back that cookie to the server knows who did the login.
I use it like that:
' Web service login
loWebService.CookieContainer = New System.Net.CookieContainer
llLogged = loWebService.Login(lcUsername, lcPassword)
If Not llLogged Then
MessageBox.Show("Unable to log in to the Web Service", lcWindowCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning)
Running.Text = ""
Return
End If
So, before sending the call to the login method, I create the cookie container assigned to the Web Service object. So, it means that if a cookie is sent back to me, after the Login() call, it will live in the Web Service object.
But, in that scenario, the cookie is created on the server side. In your case, you are trying to create it from the client side which will differ.