Can I use an

2019-04-07 02:44发布

Look at this situation:

  1. www.websitea.com displays an img tag with a src attribute of www.websiteb.com/image.aspx?id=5 and style="display:none"
  2. www.websiteb.com returns an clear image, in addition to a cookie with a name of referrer and value of 5 (created server-side from validated querystring.)

Would the cookie be created on domain www.websitea.com or www.websiteb.com?

Currently I'm sure a series of redirects with querystrings and to achieve cross-domain cookies, but I came up with this image idea a little ago. I guess I could also use an iframe.

Thanks!

5条回答
Bombasti
2楼-- · 2019-04-07 03:22

The cookie is created from the request to websiteb.com so yea... the cookie goes to websiteb scope

查看更多
Viruses.
3楼-- · 2019-04-07 03:26

The cookie would be created for websiteb.com.

查看更多
We Are One
4楼-- · 2019-04-07 03:40

Ok looks good. Tested in all browsers. Added a P3P tag for IE6, not sure if it was necessary though.

<%@ 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>
查看更多
唯我独甜
5楼-- · 2019-04-07 03:42

You're on the right track. As others have mentioned, the cookie would be created for websiteb.com.

To overcome issues with IE you'll probably need to ad a Compact Privacy policy.

Start here: http://msdn.microsoft.com/en-us/library/ms537342.aspx and Google for the rest.

查看更多
家丑人穷心不美
6楼-- · 2019-04-07 03:46

Check out: cross-domain-user-tracking

Someone mentions using a 1x1 image for tracking across domains.

查看更多
登录 后发表回答