开发者

Get the Session info from Request.GetResponse()

开发者 https://www.devze.com 2023-01-28 00:06 出处:网络
I have an aplication that loads many asp.net pages and in e开发者_开发问答very loop I need to take some information from the Sesion of the loaded page.

I have an aplication that loads many asp.net pages and in e开发者_开发问答very loop I need to take some information from the Sesion of the loaded page.

How can I do that?

example:

WebRequest request = HttpWebRequest.Create(url);

WebResponse response = request.GetResponse();
//How to get the Session from response???


You can't. Session state object is on the server.


If this were even remotely possible it would be a security nightmare. Session data is protected in the server's memory and is only accessible to objects running within the application pool of the site. If you need information from a remote page in this manner, the remote page will have to be restructured to provide the information either through added headers or cookies.

0

精彩评论

暂无评论...
验证码 换一张
取 消