HTTP ONLY 过滤器关键代码

if (response.containsHeader( "SET-COOKIE" )) {
  String sessionid = request.getSession().getId();
  response.setHeader( "SET-COOKIE", "JSESSIONID=" + sessionid
                      + ";Path=/<whatever>; HttpOnly" );
}

你可能感兴趣的:(http)