无法重新加载页面后有两个饼干

问题描述:

为什么我不能重新加载相同的页面后,我通过setcookie()函数创建两个饼干? 重载后页面一直加载到超时,在apache日志中没有任何错误消息,在Chrome开发者工具中没有任何错误消息。 这个问题可能与javascript崩溃,因为我删除了HTML中的行,页面可以加载,任何方法来纠正这个错误?无法重新加载页面后有两个饼干

这是代码:

<!doctype html> 
<html> 
<head> 
<?php include "**cookie2.php**";?> 
<!--other content in head--> 
</head> 
<body> 
**<!--a button onclick will run cookie1.php-->** 
<!--other contents in body--> 
<script src="**readcookie1.js**" language="javascript"></script> 
</body> 
</html> 

in file **cookie1.php** 
{ 
**setcookie("login",1,0,"/");** 
} 

in file **cookie2.php** 
{ 
**setcookie("pageView",0,0,"/");** 
} 

in file **readcookie1.js** 
{ 
//use **document.cookie** to get cookie2 
} 
+2

分享你的代码 –

+0

没有看到有问题的代码,我们无法为你提供帮助。 – Qirel

+0

我已添加我的代码。 –

哦,我发现这个问题。 我在javascript中读取cookie的函数有bug,所以进程卡在那里。我修改了它。