I have found a few posts on this topic and have tried to follow the suggestions in the posts but have not been successful.
I am trying to use XMLHTTP to build a page. The end result is that I want to append several pages together and then print them. But for now I'm just trying to get it work with one page, putting the generated page text into a variable. I'll build from there once I get this working. However, I am having a problem with getting past my site's authentication. I saw a few posts on this same issue, and decided to try to send the cookies on the request header. Here is the code that I have (my actual URL chagned to protect the innocent).
I log into the application, navigate to the point at which I would be running this when it is working, then load this page (test_print_2.asp) and I get the login page instead of the page I want to build. So it is not recognizing the session variables. Any ideas as to what I'm doing wrong?
I will post a separate comment with a link to the EE post that sent me in this direction.
==========================
==========
==========
=======
<%@ Language = VBScript %>
<%
Response.Buffer = True
Dim objXMLHTTP, xml, myVariable
' Create an xmlhttp object:
Set objHTTP = Server.CreateObject("MSXML
2.ServerXM
LHTTP")
' Call the page
objHTTP.Open "GET", "
http://mydomain/myapp/mypage.asp?q_type=Current", False
objHTTP.setRequestHeader ("cookie") = Request.Cookies
' Put this in twice due to MS bug
objHTTP.setRequestHeader ("cookie") = Request.Cookies
objHTTP.Send
myVariable = objHTTP.responseText
Set xml = Nothing
%>
<html>
<body>
Saved into variable.
The contents of the xml variable:
<%=myVariable%>
</body>
</html>
ASKER
https://www.experts-exchange.com/questions/20656050/Set-session-cookies-with-XML.html?sfQueryTermInfo=1+session+xmlhttp