Solved

asp/vbscript ServerXMLHTTP cookies

Posted on 2012-03-19
3
1,350 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now