Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with cookies and XMLHTTP30

Status
Not open for further replies.

trader12345

Programmer
Mar 26, 2006
1
GB
I am trying to execute an auto-login into a https server.
I used the XMLHTTP30 server object successfully for 18 months.
Now something has changed on this server so that when i try execute the auto login, it says that 'Cookies are not enabled on my browser'.

When i copy and paste the login url into IE6 browser, the login works perfectly. I check my cookies folder and they are there.
When i use the XMLHTTP object to do the same thing, it doesnt work, and no cookies get dropped onto the client machine.

The code snippet is as follows:

Dim httpSocket As New MSXML2.ServerXMLHTTP
xURL = "param = "username=test&password=123"

httpSocket.Open "POST", xURL, False
httpSocket.setRequestHeader "Content-Type", "application/x-httpSocket.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
httpSocket.send param

MsgBox httpSocket.getAllResponseHeaders

d = Now
Do Until DateDiff("s", d, Now) > 30 Or blnComplete
If httpSocket.readyState = 4 Then blnComplete = True
DoEvents
Loop
If Not blnComplete Then
MsgBox "No Response from the server."
httpSocket.abort
End If

What i dont understand is if the url works by copying and pasting into the browser, why doesnt it work with the xml object? Am i missing something in the headers? Why are the cookies not getting dropped onto the client?

Thank you in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top