//index.jsp

<body>
      <%
          session.setAttribute("str", "COOKIE");
          String url = new String("third.jsp");
          url = response.encodeUrl(url);
       %>
       <a href = "<%= url %>"> 显示</a>
</body>

//third.jsp

<body>
  <%=
      session.getAttribute("str")
   %>
</body>