473,804 Members | 3,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.CreateOb ject("MSXML2.Se rverXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.write xmlhttp.respons eText
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 9936
mizi wrote on 05 jul 2006 in microsoft.publi c.inetserver.as p.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.CreateOb ject("MSXML2.Se rverXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.write xmlhttp.respons eText
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.publi c.inetserver.as p.general:
mizi wrote on 05 jul 2006 in microsoft.publi c.inetserver.as p.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.CreateOb ject("MSXML2.Se rverXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.wri te xmlhttp.respons eText
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.publi c.inetserver.as p.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.CreateOb ject("MSXML2.Se rverXMLHTTP")],
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
7135
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 a user from information you got from the session. Each secure app on a site must challenge the user for name and password, each and every time the user accesses it (not just once and then store it in the session). If a secure app is multi-page,...
3
3544
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 last searched word in the following Variable. Ex.: Session("Word3") = Session("Word2") Session("Word2") = Session("Word1")
2
3347
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 the user. I want that cookie should get deleted when user closes the browser without signing out. I think it is done in global.asa file . But i don;t know how to do it?
9
1962
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 asp.net uses cookies to store the user session id, but if cookies are not enabled then it will send the session id as part of the url. Is this correct?
8
3957
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 accomplished this in the past utilizing the ServerXMLHTTP object. When I try an equivalent? post utilizing the HttpWebRequest class, the response contains the html for logon.asp (the same page that was posted to), which indicates to me that in some...
7
2020
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 every session tutorial I have ever read, the author invariably mentions the 2 main ways of propagating sessions - through cookies and appended to the URL. The author also almost always talks about the method being dependent on the user's...
3
4921
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 look at /home/7604/data/tmp and it is full of session files for today. Even so, if I have cookies blocked for my site http://easyquestion.net
2
5018
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 web.config 3. Yes, I tried IE - Tools - Privacy - Accept All Cookies and also Override automatic cookie handling, Always allow session cookes
3
5007
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 web.config: <authentication mode="Forms"> <forms name=".ReMaCRM" loginUrl="~/Login.aspx" defaultUrl="~/Default.aspx" cookieless="AutoDetect" domain="" timeout="10" protection="All" /> </authentication>
0
9705
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9576
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10323
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9138
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7613
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4291
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2983
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.