我把所有的参数写后通过跳转到别的接口网站,别的接口网站会返回一个值给我,我再把这个值写到cookies中,
现在我跳转过去了,但是我不知道怎样写到我的cookies中,能写吗?我的思路有问题吗?请同行帮忙
$key =base64_encode('xxxx.com');
$url='xxx.com?id=1&name=2';
setcookie($key, $result,time()+3600, "/", ".xxxx.com",1);
echo "<meta http-equiv=refresh content='0; url=$url'>";
.......
现在我跳转过去了,但是我不知道怎样写到我的cookies中,能写吗?我的思路有问题吗?请同行帮忙
$key =base64_encode('xxxx.com');
$url='xxx.com?id=1&name=2';
setcookie($key, $result,time()+3600, "/", ".xxxx.com",1);
echo "<meta http-equiv=refresh content='0; url=$url'>";
.......
接口返回值 = 接口函数(你的参数)
setcookie(string name [, 接口返回值 [, int expire [, string path [, string domain [, bool secure]]]]] );
<?php
$value = 'something from somewhere';setcookie("TestCookie", $value);
setcookie("TestCookie", $value, time()+3600); /* expire in 1 hour */
setcookie("TestCookie", $value, time()+3600, "/~rasmus/", ".example.com", 1);
?>
当然可以,,,给的返回值,你怎么接收的?就在该文件里设置cookie
GET/POST/或其他。没测试过在a.com
setcookie($key, $result,time()+3600, "/", ".b.com",1);
这样b.com是否可以接收到cookie.
如果你存这个cookie,在b.com不会用到,就不要这样存。
如果要用到,在跳转到对方望站的时候,对方就可以直接存,因为是跳转的