用js写的cookies 怎么用c#读出来

来源:百度知道 编辑:UC知道 时间:2024/06/03 18:54:06
为什么 用js写的cookies 用c#读不出来
代码如下
js
if(form1.abc2.checked)form1.word.value=' 您选用雅虎搜索';

if(form1.abc4.checked)form1.word.value=' 您选用google搜索';

if(form1.abc6.checked)form1.word.value=' 您选用百度搜索';

var Days = 30; //此 cookie 将被保存 30 天
var exp = new Date(); //new Date("December 31, 9998");
var value ;
if(form1.abc6.checked)
{
value="baidu";
}
if(form1.abc4.checked)
{
value="googel";
}
if(form1.abc2.checked)
{
value="yahoo";
}
exp.setTime(exp.getTime() + Days*24*60*60*1000);

alert(value);
document.cookie="type="+escape(value)+";expires=" + exp.toUTCString();

怎么可能读不出来..都是操作的本机cookie.

如果你确定你的js能写入cookie.

那不管用什么读都能读出来.

if(Request.Cookies["test"]!=null){
string id=Request.Cookies["test"].Values["id"].ToString();
string name=Request.Cookies["test"].Values["name"].ToString();
}

requset.cookie[""]=