在测试域上写入cookie并在第二内部域上读取它
|
我们有2个测试环境,分别是:
http://test.example.com/(这是我们的
前端CMS测试网站)
http:// test-example /(这是我们的
内部开发地点在哪里
收集数据,等等)
以下是在\“ test.example.com \”域上编写的cookie。用户将到达将Cookie写入其计算机的页面,然后单击链接,将其带到我们的内部测试域\“ test-example \”。我观察到他们离开\“ test.example.com \”并被带到我们的内部测试域\“ test-example \”时,cookie不在此跟踪,因为我无法读取该cookie。
任何人都可以帮助我的代码,以允许在我们的内部测试域中读取Cookie吗?
<script type=\"text/javascript\">
var cookieName = \'HelloWorld\';
var cookieValue = \'HelloWorld\';
var myDate = new Date();
myDate.setMonth(myDate.getMonth() + 12);
document.cookie = cookieName +\"=\" + cookieValue + \";expires=\" + myDate
+ \";domain=.example.com;path=/\";
</script>
没有找到相关结果
已邀请:
2 个回复
蹄渭信妥扳
献导外拘