gpt4 book ai didi

java - 在 php 中使用 js api 使用 Evercookie 创建 cookie 时出现问题

转载 作者:行者123 更新时间:2023-12-03 11:18:43 24 4
gpt4 key购买 nike

我想用ever cookie创建永久cookie,但是当我在本地主机(Php wamp服务器)上运行ever cookie程序时,它不会创建任何cookie并显示以下错误

Not Found
The requested URL /php/evercookie_etag.php was not found on this server.

Not Found
The requested URL /php/evercookie_cache.php was not found on this server.

我已经从这个链接下载了它http://github.com/samyk/evercookie

我想创建一个永久cookie,以便我可以识别运行网页的系统,下面是我的代码,请帮助解决我的问题,提前致谢......

<html>
<head>
<script type="text/javascript" src="js/swfobject-2.2.min.js"></script>
<script type="text/javascript" src="js/evercookie.js"></script>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script>
//var ec = new evercookie();
var ec = new evercookie({
baseurl: '/test', http://localhost/test
asseturi: '/assets', http://localhost/test/assets
phpuri: '/php' http://localhost/test/php
});


ec.set("id", "12345");


ec.get("id", function(value) { alert("Cookie value is " + value) });


function getCookie(best_candidate, all_candidates)
{
alert("The retrieved cookie is: " + best_candidate + "\n" +
"You can see what each storage mechanism returned " +
"by looping through the all_candidates object.");

for (var item in all_candidates)
document.write("Storage mechanism " + item +
" returned " + all_candidates[item] + " votes<br>");
}
ec.get("id", getCookie);
</script>
</head>
</html>

最佳答案

您确定您的 baseurl var 是 '/test' 吗?例如,使用 github 源代码,它将是:

var ec = new evercookie({
baseurl: '/evercookie-master',
asseturi: '/assets',
phpuri: '/php'
});

关于java - 在 php 中使用 js api 使用 Evercookie 创建 cookie 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27213533/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com