格式: String,String
Cookies c = new Cookies("name","wency");
resp.addCookies(c);
获取:
Cookies [] c = req.getCookies();
Cookies编码: String info = URLEncode.encode("你好吗?","UTF-8");
Cookies解码: URLDecode.decode(info,"UTF-8");
格式: Map<key,value>
//如果存在,直接获取;不存在则创建再获取
HttpSession session = req.getSession();
//session中设置会话数据
session.setAttribute(key,value);
//获取session中的数据
session.getAttribute(key);
//删除sessuion中的数据
session.removeAttribute("key");
Cookies.简要
最新推荐文章于 2020-08-03 18:28:05 发布