Cookies 我可以使用<;img>;标记以跨域发送cookie?

Cookies 我可以使用<;img>;标记以跨域发送cookie?,cookies,cross-domain,Cookies,Cross Domain,看看这种情况: www.websitea.com显示带有www.websiteb.com/image.aspx?id=5和style=“display:none”属性的img标记 www.websiteb.com除了返回名为referer且值为5的cookie之外,还返回一个清晰的图像(从已验证的查询字符串创建服务器端) cookie是在域www.websitea.com还是www.websiteb.com上创建的 目前,我确信有一系列使用querystring的重定向来实现跨域cookie,但

看看这种情况:

  • www.websitea.com
    显示带有
    www.websiteb.com/image.aspx?id=5
    style=“display:none”属性的
    img
    标记
  • www.websiteb.com
    除了返回名为
    referer
    且值为
    5
    的cookie之外,还返回一个清晰的图像(从已验证的查询字符串创建服务器端)
  • cookie是在域
    www.websitea.com
    还是
    www.websiteb.com
    上创建的

    目前,我确信有一系列使用querystring的重定向来实现跨域cookie,但我在不久前就提出了这个图像想法。我想我也可以使用
    iframe


    谢谢

    将为websiteb.com创建cookie。

    cookie是根据对websiteb.com的请求创建的,因此是。。。cookie将进入Web站点范围

    签出:


    有人提到使用1x1图像进行跨域跟踪。

    Ok看起来不错。在所有浏览器中测试。为IE6添加了一个P3P标签,但不确定是否有必要

    <%@ Page Language="VB" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
            Response.AddHeader("P3P", "CP=""CAO PSA OUR""")
            Dim passedlocalizeID As String = Request.QueryString("id")
            Dim localizeID As Integer
            If passedlocalizeID IsNot Nothing AndAlso Int32.TryParse(passedlocalizeID, localizeID) Then
                Dim localizer As New Localizer
                localizer.LocalizeTo(localizeID)
            End If
        End Sub
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Redirecting . . .</title>
        <meta http-equiv="refresh" content="0;URL=/" />
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        </div>
        </form>
    </body>
    </html>
    
    
    受保护的子页加载(ByVal sender作为对象,ByVal e作为System.EventArgs)
    Response.AddHeader(“P3P”,“CP=”“CAO PSA OUR”“”)
    Dim passedlocalizeID为String=Request.QueryString(“id”)
    Dim localizeID为整数
    如果passedlocalizeID不是Nothing并且也是Int32.TryParse(passedlocalizeID,localizeID),那么
    将定位器变暗为新定位器
    定位器。定位器(定位器ID)
    如果结束
    端接头
    重定向。
    
    你走对了方向。正如其他人提到的,cookie将为websiteb.com创建

    为了克服IE的问题,你可能需要广告一个紧凑的隐私政策


    从这里开始:剩下的就从谷歌开始。

    我将此标记为答案,因为它最终解决了我在ie6上的问题