服务器向客户端发送cookie时,发送的cookie的值是admin,从服务器读取客户端的cookie时,cookie的值就变成0967F215EC5C6DD5D2568B3B6679042F,客户端使用ie浏览器,在windows的cookie文件夹里只有一个cookie记事本文件,还有一个叫index的文件,我不知道它是什么。
这是怎么回事?发送cookie代码:
Cookie c1=new Cookie("username","admin");
c1.setMaxAge(60*60*24);
c1.setPath("/");
response.addCookie(c1);
读取cookie代码:
Cookie[] myCookie1=request.getCookies();
for(int n1=0;n1<myCookie1.length-1;n1++)
{
Cookie newCookie1= myCookie1[n1];
String temp3=newCookie1.getValue();
out.print(temp3);
这是怎么回事?发送cookie代码:
Cookie c1=new Cookie("username","admin");
c1.setMaxAge(60*60*24);
c1.setPath("/");
response.addCookie(c1);
读取cookie代码:
Cookie[] myCookie1=request.getCookies();
for(int n1=0;n1<myCookie1.length-1;n1++)
{
Cookie newCookie1= myCookie1[n1];
String temp3=newCookie1.getValue();
out.print(temp3);
解决方案 »
- struts2 result 问题
- jbuilder2006+jboss中写个简单的jsp,出错:Invocation Error
- dwr结合struts2的问题,麻烦了
- 点击按钮页面会自动刷新?
- 刚用c#设计制作的网站荆州市妇幼保健院“金色未来” 亲子园,欢迎网友访问,并提出改进意见!(比如 美工上.内容上和c#程序制作方面哪些
- 网页上这种图片模块怎么实现?
- 页面打印报错:ActiveX不安全
- 急需 jdbc 驱动,那里有免费的 for sql server 7.0
- 关于<jsp:include >的问题
- 到哪里下载java web server,请大虾指点
- 在线等css,java大神,CSS大神阿 ,100分奖励快进来看看阿!!
- 根据一个路径,让服务器那边读取我本地的数据
for (int n1 = 0; n1 < myCookie1.length; n1++) {
Cookie newCookie1 = myCookie1[n1];
String temp3 = newCookie1.getValue();
out.print(newCookie1.getName() + "=" + temp3);
}