ASP会话 [英] ASP Sessions

查看:91
本文介绍了ASP会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在客户端组件中使用ServerXmlHttp基本上在网页中与服务器对话

。我希望能够在服务器上缓存一些

信息,这样当我回调时,我没有必要重新计算我为初始请求所做的一切。但是,

会话是不同的。


有没有办法让ServerXmlHttp会话模仿IE客户端

session ?


这是一个快速运行

设置Conn = ADODB.Connection

''初始化并打开连接
Conn.GetMassiveAmountOfDataFromFarAwayDataLocation ID,RS

XmlStr = FormatDataAsXml(RS)

Session(" CurrentData")= XmlStr


''*******************************


''ServerXmlHttp加载并请求相同的东西。由于各种各样的原因,我不希望将XML作为HTML中的xml标记发送出去。所以,

基本上问题是,是否有一种方法可以将ServerXmlHttp嵌入到

a客户端HTML页面中,以访问上面指定的Session变量?


谢谢,

BB

I am using ServerXmlHttp in a client-side component to basically talk back
to the Server within a webpage. I would like to be able to cache some
information on the server so that when I callback, I do not have to
reconstitue everything that I did for the intial request. However, the
Sessions are different.

Is there a way to get the ServerXmlHttp session to impersonate the IE client
session?

Here is a quick run down
Set Conn = ADODB.Connection
'' Initialize and open Connection
Conn.GetMassiveAmountOfDataFromFarAwayDataLocation ID, RS

XmlStr = FormatDataAsXml( RS )

Session( "CurrentData" ) = XmlStr

'' *******************************

'' The ServerXmlHttp Loads and would request the same thing. For a variety of
reasons, I do not want the XML sent down as an xml tag in the HTML. So,
basically the question is, Is there a way for the ServerXmlHttp, embedded in
a client HTML page, to access the Session variable specified above?

Thanks,
BB

推荐答案

我找到了另一组的答案(WINHTTP I相信):这是

最后一个

所以,更简单的方法就是:


<脚本>

函数GetCookieData(){

var cookieString = document.cookie;

返回cookieString;

}


函数GetSession(){

var myCookies = GetCookieData(); //这将传递所有cookie


var xmlServerHttp = new ActiveXObject(" Msxml2.ServerXMLHTTP.4.0");

xmlServerHttp.open(" GET"," http://MyServer/SessionNumberServer.asp",

false);

xmlServerHttp.setRequestHeader(" COOKIE",myCookies); //''HTTP_''前缀

已添加

xmlServerHttp.send();

alert(xmlServerHttp.responseText); //这应该来自同一个

会话

}

< / script>


谢谢,

BB

" bobbyballgame" <所以***** @ microsoft.com>在消息中写道

news:uv **************** @ TK2MSFTNGP10.phx.gbl ...
I worked out the answer on another group ( WINHTTP I believe): here is the
last of it
So, an easier way, to do this is:

<script>
function GetCookieData( ){
var cookieString = document.cookie;
return cookieString;
}

function GetSession(){
var myCookies = GetCookieData(); // This will pass all cookies

var xmlServerHttp = new ActiveXObject("Msxml2.ServerXMLHTTP.4.0");
xmlServerHttp.open("GET", "http://MyServer/SessionNumberServer.asp",
false);
xmlServerHttp.setRequestHeader("COOKIE", myCookies); // ''HTTP_'' prefix
is added
xmlServerHttp.send();
alert( xmlServerHttp.responseText ); // This should be from the same
session
}
</script>

Thanks,
BB
"bobbyballgame" <so*****@microsoft.com> wrote in message
news:uv****************@TK2MSFTNGP10.phx.gbl...
我正在使用客户端组件中的ServerXmlHttp基本上可以在网页内与服务器进行对话。我希望能够在服务器上缓存一些
信息,这样当我回调时,我不必重新构建我为初始请求所做的一切。但是,
会话是不同的。

有没有办法让ServerXmlHttp会话模仿IE
客户端会话?

这是一个快速运行

设置Conn = ADODB.Connection
''初始化并打开连接
Conn.GetMassiveAmountOfDataFromFarAwayDataLocation ID,RS

XmlStr = FormatDataAsXml(RS )

会话(" CurrentData")= XmlStr

''********************** *********

''ServerXmlHttp加载并请求同样的事情。对于各种各样的
的原因,我不希望XML作为HTML中的xml标记发送。所以,基本上问题是,是否有一种方法可以在客户端HTML页面中嵌入
的ServerXmlHttp来访问上面指定的Session变量?

谢谢,
BB
I am using ServerXmlHttp in a client-side component to basically talk back
to the Server within a webpage. I would like to be able to cache some
information on the server so that when I callback, I do not have to
reconstitue everything that I did for the intial request. However, the
Sessions are different.

Is there a way to get the ServerXmlHttp session to impersonate the IE client session?

Here is a quick run down
Set Conn = ADODB.Connection
'' Initialize and open Connection
Conn.GetMassiveAmountOfDataFromFarAwayDataLocation ID, RS

XmlStr = FormatDataAsXml( RS )

Session( "CurrentData" ) = XmlStr

'' *******************************

'' The ServerXmlHttp Loads and would request the same thing. For a variety of reasons, I do not want the XML sent down as an xml tag in the HTML. So,
basically the question is, Is there a way for the ServerXmlHttp, embedded in a client HTML page, to access the Session variable specified above?

Thanks,
BB



这篇关于ASP会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆