Solved

asp/vbscript ServerXMLHTTP cookies

Posted on 2012-03-19
3
1,413 Views
Last Modified: 2012-04-11
I have code similar to the following. The returned page is the logged in page as expected. However, no cookies are returned in the header which is:

Date: Mon, 19 Mar 2012 10:58:03 GMT Server: Apache/2.0.64 (Unix) mod_ssl/2.0.64 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 X-Powered-By: PHP/5.2.9 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html

I really want to return the cookies and their values. Any idea why this is not working?

set xmlObj = Server.CreateObject("Microsoft.XMLDOM")
Set xmlHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP.6.0")
xmlHTTP.Open "POST","http://www.domain.com/",false
xmlHTTP.SetRequestHeader "Content-type", "application/x-www-form-urlencoded"
xmlhttp.setrequestheader "Cookie","cookie2=boom"
xmlhttp.setrequestheader "Cookie","cookie1=dummy"
xmlHTTP.Send "username=xxxxx&action=Login&password=yyyyy"

strheaders=xmlhttp.getallresponseheaders()

response.write "<p>" & (strheaders) & "</p>"

response.write (xmlHTTP.ResponseText)

Open in new window

0
Comment
Question by:shafferb1
  • 2
3 Comments
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37742023
Try setting the cookies in one go.


'this value is ignored, but the step is necessary
xmlhttp.setRequestHeader "Cookie", "dummy"
'set all cookies here
xmlhttp.setRequestHeader "Cookie", "cookie1=boom; cookie2=dummy"

Open in new window

0
 

Accepted Solution

by:
shafferb1 earned 0 total points
ID: 37746183
No change. However, the point is, that cookies that are being set on their side should be returned. Not that I should be setting the cookies.
0
 

Author Closing Comment

by:shafferb1
ID: 37831631
no correct answer
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question