How can I retrieve the content of a classic ASP page which includes session information from the current page? There are very few restrictions, but both scripts must run on localhost. The code below will be your starting point.
I am working with IIS and classic ASP code ONLY.
1. Set session variables in http://localhost/[login to view URL]
2. Retrieve the contents of http://localhost/[login to view URL]
I don't care if you're new or experienced at GAF. I just need working code. For multiple winners, the best code (elegant & explanatory) will win the $$$.
<%
' - beginning of: http://localhost/[login to view URL]
option explicit
dim strURL, objHTTP, strFetch, dicDictionary
' - set session variables
set dicDictionary=createobject("scripting.dictionary")
dicDictionary("boolean")=true
dicDictionary("string")="firstname"
dicDictionary("date")=now()
set dicDictionary("strings")=createobject("scripting.dictionary")
dicDictionary("strings")("first")="first string"
dicDictionary("strings")("second")="second string"
session("test_1")="test number 1"
set session("test_2")=dicDictionary
' - show the session data:
%>
Session data from <strong>set_session_info.asp</strong>:<br>
--------------------------------------------<br>
session.sessionid=<%=[login to view URL]%><br>
test_1=<%=session("test_1")%><br>
test_2.boolean=<%=session("test_2")("boolean")%><br>
test_2.string=<%=session("test_2")("string")%><br>
test_2.date=<%=session("test_2")("date")%><br>
test_2.strings.first=<%=session("test_2")("strings")("first")%><br>
test_2.strings.second=<%=session("test_2")("strings")("second")%><br>
--------------------------------------------<br>
<br>
<%
strURL="http://localhost/retrieve_session_info.asp"
set objHTTP = [login to view URL]("Microsoft.XMLHTTP")
[login to view URL] "GET", strURL, false
[login to view URL]
strFetch=[login to view URL]
set objHTTP = nothing
[login to view URL] "Content retrieved from <strong>" & strURL & "</strong>:<br>"
[login to view URL] "----------------------------------<br>"
[login to view URL] strFetch
[login to view URL] "<br>----------------------------------<br>"
' - end of: http://localhost/[login to view URL]
%>
<%
' - beginning of: http://localhost/[login to view URL]
option explicit
' - begin code to retrieve session data
' - YOUR CODE GOES HERE
' - end code to retrieve session data
%>
session.sessionid=<%=[login to view URL]%><br>
test_1=<%=session("test_1")%><br>
test_2.boolean=<%=session("test_2")("boolean")%><br>
test_2.string=<%=session("test_2")("string")%><br>
test_2.date=<%=session("test_2")("date")%><br>
test_2.strings.first=<%=session("test_2")("strings")("first")%><br>
test_2.strings.second=<%=session("test_2")("strings")("second")%><br>
<%
' - end of: http://localhost/[login to view URL]
%>
Your session containing dictionary object data. So, for parsing the session value, create a dictionary variable, and set the variable to session object.
I am an IT professional with 10 yrs experience with ASP Classic. I have very good experience with ASP Session object. I will provide quick & professional service.
We have read your requirements carefully and we have the technical expertise and creativity essential for creation of your website with all the required features. You will receive unlimited revisions until you are completely satisfied. We take pride in providing great service economically. We are available 16 hours a day, 7 days a week. We can communicate through phone, email, messengers and message board. . If possible, open private message board to discuss your requirements in detail. Thanks, SN TECH SOLUTIONS