200分关于跨站点cookie问题??

coffee_cn 2003-05-22 01:34:34
加精
流程:
1、文件1:输入用户名、密码;
2、文件2:接受输入并做简单判断,
然后用xmlhttp把他post到http://www.xxx.com/login.asp
3、文件2:通过返回的文件判断密码是否正确;
正确asp:response.redirect "www.xxx.com/index.asp"
结果:
1、登陆不成功,出现“超时已过期,请重新登陆”

问题:
请问如何解决?

分数:200分相送,并且言语感谢!!!
...全文
82 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
coffee_cn 2003-06-04
  • 打赏
  • 举报
回复
最后up一次,明早结贴。。。。
coffee_cn 2003-05-30
  • 打赏
  • 举报
回复
<script language="JScript">
function PostOrder(xmldoc)
{
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.Open("POST", "http://myserver/orders/processorder.asp", false);
xmlhttp.Send(xmldoc);
return xmlhttp.responseXML;
}
</script>


http://myserver/orders/processorder.asp这里是不是必须是本地服务器??
孟子E章 2003-05-23
  • 打赏
  • 举报
回复
test.asp

=======================
<%
strName = "aa"
strPwd="bb"
Set x = Server.CreateObject("Microsoft.XMLHTTP")
str = "name=" & strName & "&pwd=" & strPwd
x.Open "POST","http://localhost/asp/Login.asp",False
x.setRequestHeader "Content-Length",Len(str)
x.setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
x.send str
If Trim(x.responseText) = "ok" Then
Response.Redirect "http://lucky_elove.www1.dotnetplayground.com/"
Else
Response.write "无效密码和名字"
End if

%>


Login.asp
=---------------
<%
If Request.Form("name") = "aa" And Request.Form("pwd") = "bb" Then
Response.write "ok"
Else
Response.write "fail"
End If
%>
coffee_cn 2003-05-23
  • 打赏
  • 举报
回复
up by self
coffee_cn 2003-05-23
  • 打赏
  • 举报
回复
up by self
Jaron 2003-05-22
  • 打赏
  • 举报
回复
啊,原来是这样,不早说。大家帮你再想想。。。。
coffee_cn 2003-05-22
  • 打赏
  • 举报
回复
问题还是没有解决,准备再次放200分!!
我搜索一些资料也没有找到,只要提供线索者一录有分
谢谢
coffee_cn 2003-05-22
  • 打赏
  • 举报
回复
哎呀,老兄,远程服务器我不能修改呀,要是能修改我就没有必要这么麻烦了呀。
luok 2003-05-22
  • 打赏
  • 举报
回复
“然后用xmlhttp把他post到http://www.xxx.com/login.asp”


这个LOGIN。ASP,你能修改么? 如果能,登陆之前,用COOKIES记下这个 USER,POST到远端,成功后你叫他返回你本地http://www.YYYYYYYYYYYYYYYYYYYYY.com/loginOK.asp?USERN=USERN&PWD=PWD&CHECKok=ok
loginOK.asp里面,给COOKISE(“USER”)登陆就是了。

如果验证不成功,返回你本地http://www.YYYYYYYYYYYYYYYYYYYYY.com/loginNO.asp?USERN=USERN&PWD=PWD&CHECKok=ok
清除COOKISE(“USER”),告诉他帐号不对。
coffee_cn 2003-05-22
  • 打赏
  • 举报
回复
php有怎么可以,能否提交解决方案或提示
coffee_cn 2003-05-22
  • 打赏
  • 举报
回复
up by self
coffee_cn 2003-05-22
  • 打赏
  • 举报
回复
刚才贴的数据是: objXML.getAllResponseHeaders()

下面才是:objXML.responsebody
<html>
<head>
<script language="JavaScript">
window.top.location.replace ( "frame_index.php" ) ;
</script>
</head>
</html>


谢谢各位支持,不过到现在我还是没有解决问题。
肄若芸 2003-05-22
  • 打赏
  • 举报
回复
..
coffee_cn 2003-05-22
  • 打赏
  • 举报
回复
补充:
我的程序是asp程序,本地web服务器,远程服务器是php
coffee_cn 2003-05-22
  • 打赏
  • 举报
回复
返回数据已经得到:
Date: Thu, 22 May 2003 03:38:51 GMT Server: Apache/1.3.27 (Unix) Resin/2.1.6 mod_throttle/3.1.2 mod_ssl/2.8.12 OpenSSL/0.9.6b X-Powered-By: PHP/4.2.3
Set-Cookie: lang= Set-Cookie: lang=zh-CN Set-Cookie: sessionKey= Set-Cookie: sessionKey=9bcb7b516063c0bb5218e11f5da4e9a4 Set-Cookie: lang= Set-Cookie: lang=zh-CN Connection: close Content-Type: text/html
Jaron 2003-05-22
  • 打赏
  • 举报
回复
<%
url="http://login.asp?user=abc&pwd=cde&thisurl=http://my.xxx.com"
return_data=getHTTPPage(url) '<-- 分析这里面的东西

function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Msxml2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then exit function
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function

Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function %>
lvjinyou 2003-05-22
  • 打赏
  • 举报
回复
看看你返回的是什么数据!
Jaron 2003-05-22
  • 打赏
  • 举报
回复
把返回的数据分析一下
yuhf 2003-05-22
  • 打赏
  • 举报
回复
除非你用明文,get上去
yuhf 2003-05-22
  • 打赏
  • 举报
回复
php可以,asp好像不行
加载更多回复(2)

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧