getSession赋值

  String randomFormKey = "FK" + StringUtil.getRandomString(8, ConstantUtil.REDPACKET_NUMBER_SEEDSOURCE);
  request.getSession().setAttribute(randomFormKey, randomFormKey);
  webOut(response, randomFormKey);

//获取SESSION

request.getSession().removeAttribute(formKey);

原文地址:https://www.cnblogs.com/cuijinlong/p/6277703.html