我现在写的程序能在windows下读取没有问题,而在linux下不能读取,cookie已经添加了,是不是和linux下的路径有关系,。
//写的
Cookie user = new Cookie( "userInfo" , mail + "_" + firstName + "_" + lastName + "_" + phone); 
user.setComment( "A test cookie" ); 
user.setMaxAge(14*24*60*60); 
user.setPath("/");
response.addCookie(user);
//取
          Cookie[] cookie = request.getCookies();
if(cookie != null && cookie.length >= 1)
{
      HttpSession sn = request.getSession();
String user = cookie[0].getValue();

String[] users = user.split("_");
int num = users.length;