CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

xmlhttp的有关cookie的一个问题!

楼主igotit(挽回不了)2003-09-04 00:37:24 在 Web 开发 / ASP 提问

xmlhttp的有关cookie的一个问题!  
  我用xmlhttp登录一个网页后,再向登录后的网页发送表单信息,返回说我未登录,估计是因为cookie的原因,可是用xmlhttp怎么解决这个问题呢  
   
  代码比如:  
  Dim   logxml,   idpw,   postxml,   info  
  idpw="id=abc&pw=pass"  
  Set   logxml   =   Server.CreateObject("Microsoft.XMLHTTP")  
  logxml.Open   "POST",   "http://myserver/login",   False  
  logxml.Send   idpw  
   
  info="title=hello&content=world"  
  Set   postxml   =   Server.CreateObject("Microsoft.XMLHTTP")  
  postxml.Open   "POST",   "http://myserver/post",   False  
  postxml.Send  
   
  似乎两次POST是毫不相关的两次请求,因此认为后者是未登录的情况下要发表单信息,请高手指点如何解决!  
  问题点数:0、回复次数:5Top

1 楼saucer(思归)回复于 2003-09-04 01:10:55 得分 0

use   xmlhttp's   getResponseHeader   and   setRequestHeader   method  
   
  Dim   logxml,   idpw,   postxml,   info,   cookie  
  idpw="id=abc&pw=pass"  
  Set   logxml   =   Server.CreateObject("Microsoft.XMLHTTP")  
  logxml.Open   "POST",   "http://myserver/login",   False  
  logxml.Send   idpw  
  cookie   =   logxml.getResponseHeader("Set-Cookie")  
   
  info="title=hello&content=world"  
  Set   postxml   =   Server.CreateObject("Microsoft.XMLHTTP")  
  postxml.Open   "POST",   "http://myserver/post",   False  
  postxml.setRequestHeader("Cookie",cookie)  
  postxml.Send  
  Top

2 楼anita2li(hehe...)回复于 2003-09-04 08:10:33 得分 0

UPTop

3 楼igotit(挽回不了)回复于 2003-09-04 16:30:12 得分 0

还是不行!  
  我刚知道有responseheader相关的三个函数,我刚才试了下  
  用.getResponseHeader("Set-Cookie")取得的值是空的  
  用.getAllResponseHeaders取得的值是  
  Connection:   close   Date:   Thu,   04   Sep   2003   08:12:51   GMT   Server:   Apache/1.3.26   (Unix)   PHP/4.2.0   mod_gzip/1.3.19.1a   mod_fastcgi/2.2.10   Content-Type:   text/html;   charset=gb2312    
  里面没有cookie的信息  
  搞不懂服务器是如何判断我与它是否相连的呢?ip地址是不会变的啊!  
  Top

4 楼igotit(挽回不了)回复于 2003-09-04 23:10:01 得分 0

还有人可以帮助我吗?  
  Top

5 楼saucer(思归)回复于 2003-09-04 23:25:06 得分 0

do   the   login/post   in   the   browser   and   carefully   examine   the   html   page   coming   back   and   see   if   there   are   any   hidden   input   controls   with   session   information  
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
  Top

相关问题

  • 救命啊,有关xmlHttp的问题
  • 有关xmlhttp的入门级问题
  • xmlhttp是否能设置Cookie?
  • 有关Cookie的困惑
  • 急有关cookie的问题
  • 有关使用xmlhttp 实现多文件上传的问题
  • 有关xmlHttp的问题,帮我看看哪里有错
  • 高手帮我看一下是什么问题,有关xmlhttp的
  • 120求助有关cookie的问题
  • 请教有关cookie的问题!!!

关键词

  • 信息
  • microsoft
  • server
  • logxml
  • postxml
  • xmlhttp
  • myserver
  • getresponseheader
  • post
  • cookie

得分解答快速导航

  • 帖主:igotit

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo