1

我正在设置一个Cookie。下面是代码,

var myCookie="MyCookie";
document.cookie = myCookie+"="+escape("myValue")+ ";expires="+";path=/;";

此代码在我的 xhtml 页面中。我可以Cookie在 Chrome 和 FF 浏览器中看到这一点。但不在 IE 中(IE7、8 和 9)

我基本上是在尝试使用这个在 Apache Web 服务器中编写重写规则Cookie。但是,由于这Cookie在 IE 中没有被检测到,因此不会发生重写。然而,它发生在 Chrome 和 FF 中。

下面是重写规则。

RewriteEngine On
RewriteCond %{HTTP:Cookie}  MyCookie=([a-zA-Z0-9]+)
RewriteCond %{REQUEST_URI} ^/web/portal/login
RewriteRule .* http://%{SERVER_NAME}/web/portal/home [R=302]

为什么在 IE 中未检测到Cookie设置?document.cookie

4

0 回答 0