Solved

asp/vbscript ServerXMLHTTP cookies

Posted on 2012-03-19
3
1,476 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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 create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

734 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