跨域iframe插入cookie

时间:2010-11-16 14:51:59

标签: cookies iframe cross-domain

我需要使用相同的脚本跟踪我拥有的网站的访问者。

我拥有example.comsite.com

我想使用iframe在site.com/track.aspx中插入example.com

track.aspx会将Flash-cookie插入访问者计算机,并将一些数据保存到数据库中。

怎么做?我可以在不使用iframe的情况下获得相同的结果吗?

1 个答案:

答案 0 :(得分:0)

这是一种重定向机制。

track.aspx会为site.com域写一个cookie,但你想要一个可以在example.com域中读取的cookie(我假设)

example.com中创建一个页面,将Cookie和重定向写入site.comsite.com中创建一个重定向到example.com

的页面

site.com/FirstPage.aspx重定向到example.com/writecookie.aspx?val=abcexample.com/writecookie.aspx写下Cookie并重定向到site.com/track.aspx

site.com/firstpage.aspx粘贴到您的Iframe中,然后让它重新定向。

相关问题