客户端会话技术,客户端保存,用于存储少量不太敏感的数据,在不登陆的情况下完成服务器对客户端的身份识别
new Cookie(String name, String value)
response.addCookie(Cookie cookie)
Cookie[] request.getCookies()
setMaxAge(int seconds)
setPath(String path)
为"/"setDomain(String path)
服务器会话技术,服务器端保存,没有数据大小限制
HttpSession session = request.getSession()
Object getAttribute(String name)
void setAttribute(String name, Object value)
void removeAttribute(String name)
原文:https://www.cnblogs.com/yxmhl/p/10660386.html