473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

ServerXMLHTTP, session and cookies

I try to use ServerXMLHTTP object to get the session infomation from a
remote webpage, but it always returns nothing.

the follwoing is my code:

*local.asp*
url = "http://domain/remote.asp"
set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.write xmlhttp.responseText
set xmlhttp = nothing

*remote.asp*
bLogin = Session("login")
sUserName = Request.Cookies("username")
Response.Write(nUserID & " " & sUserName)

although the session and cookie are not blank, but I cannot received any
info. please help me, thanks a lot.
Jul 5 '06 #1
4 9899
mizi wrote on 05 jul 2006 in microsoft.public.inetserver.asp.general:
I try to use ServerXMLHTTP object to get the session infomation from a
remote webpage, but it always returns nothing.

the follwoing is my code:

*local.asp*
url = "http://domain/remote.asp"
set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.write xmlhttp.responseText
set xmlhttp = nothing

*remote.asp*
bLogin = Session("login")
sUserName = Request.Cookies("username")
Response.Write(nUserID & " " & sUserName)

although the session and cookie are not blank, but I cannot received any
info. please help me, thanks a lot.
How can the remote page be in session, if it is on a different server as
the local.asp page, as a second session cookie and username cookie can not
be set then for the right domain?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 5 '06 #2
Evertjan. wrote on 05 jul 2006 in
microsoft.public.inetserver.asp.general:
mizi wrote on 05 jul 2006 in microsoft.public.inetserver.asp.general:
>I try to use ServerXMLHTTP object to get the session infomation from
a remote webpage, but it always returns nothing.

the follwoing is my code:

*local.asp*
url = "http://domain/remote.asp"
set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.write xmlhttp.responseText
set xmlhttp = nothing

*remote.asp*
bLogin = Session("login")
sUserName = Request.Cookies("username")
Response.Write(nUserID & " " & sUserName)

although the session and cookie are not blank, but I cannot received
any info. please help me, thanks a lot.

How can the remote page be in session, if it is on a different server
as the local.asp page, as a second session cookie and username cookie
can not be set then for the right domain?
On second thought, those cookies would have to exist on the server!

That will not do.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 5 '06 #3
Hi,

thanks for your reply. The two asp pages are on different servers. what I
try to do is automatic login. eg., user A has logged in at Server A. some
links on web pages of server A point to server B. so when server B detected
a visitor is coming from server A, it will check if the user has logged in
Server A. if logged in, then set the user also logged in Server B.

What I thought before is remote.asp is executed on Server B, so it can
retrive session and cookies through it. but the fact has proved I'm wrong.
I'm wondring is it possible to retrieve sessions and cookies of a remote
server?

thanks.
Jul 5 '06 #4
mizi wrote on 05 jul 2006 in microsoft.public.inetserver.asp.general:
Hi,
Please quote on usenet, this is not email.

thanks for your reply. The two asp pages are on different servers.
what I try to do is automatic login. eg., user A has logged in at
Server A. some links on web pages of server A point to server B. so
when server B detected a visitor is coming from server A, it will
check if the user has logged in Server A. if logged in, then set the
user also logged in Server B.

What I thought before is remote.asp is executed on Server B, so it can
retrive session and cookies through it. but the fact has proved I'm
wrong. I'm wondring is it possible to retrieve sessions and cookies of
a remote server?
A "session" in the ASP sense needs a cookie that is kept on the
client/browser and defines the session. Session variables reside on the
server, but are only available to pagest that show the session cookie.

So if you fetch a page of another server on a server
[by asp code Server.CreateObject("MSXML2.ServerXMLHTTP")],
the session cookie should be on that server too without
any browser on that server. That seems impossible under ASP.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
3
by: PM | last post by:
I'm trying to make a kind of search history containing the 3 last searched words. So I'm using 3 Session Variables: Word1 / Word2 / Word3. In order to get this history working, I need to put the...
2
by: Amit D.Shinde | last post by:
Hello Experts.. I need some help regarding cookies and session objects and also global.asa file I am creating one cookie when a user logs in on my website. The cookie stores the login name of...
9
by: RA | last post by:
Hi Please review and let me know if I am correct: 1) My understanding from reading http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/ diforwc-ch05.asp is that...
8
by: Dave Brown | last post by:
I am attempting to post to a url (https://FakeURL/logon.asp) using the HttpWebRequest class. The response for a succesful post will contain the html for the logon user's default page. We've...
7
by: Marcus | last post by:
I know that when you start a session in PHP, the "cookie" it creates is not the same as those that are stored in your browser's temp folder, and instead is kept in RAM. I am confused because in...
3
by: damezumari | last post by:
To find out were session variables are stored I included this instruction in my program: echo ini_get("session.save_path"); The reply was /home/7604/data/tmp which is a folder on my server. I...
2
by: StanB | last post by:
I came across this weird problem: 1. Session state stops working after the app is deployed to another server because IE does not accept cookies. 2. It works if cookieless="true" in the...
3
by: dihola | last post by:
Hi, I have a website running in IIS7 and it seems to be creating a new session for every request I make. The values I store in Session are lost with every request. This is the forms bit in my...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.