asp.net

Cookie中多个变量的设置.设置Cookie:HttpCook

2013-12-20

httpcookie xpcookie=new httpcookie("param");

 

xpcookie.values.add("yyyy",tempyear);

 

xpcookie.values.add("mm",tempmonth);

 

xpcookie.values.add("selflag",tempflag);

xpcookie.values.add("selvalue",tempvalue);

 

response.appendcookie(xpcookie);

 

接到cookie:

 

//得到cookie值

 

httpcookie getcookie=request.cookies["param"];

 

getyear=getcookie.values["yyyy"].tostring();

 

getmonth=getcookie.values["mm"].tostring();