Session是在服务器端创建的:
HttpSession session = request.getSession();
设置session里面的值:
session.setAttribute("code", "值");
取得session里面的值;
String code = session.getAttribute("code");
判断是否已经创
if (session.isNew()) {
response.getWriter().print("session创建成功,session的id是:"+sessionId);
}else {
response.getWriter().print("服务器已经存在该session了,session的id是:"+sessionId);
}