8 Replies Latest reply on Oct 6, 2007 12:47 AM by Joan Horta Tosas

    Cookies lost when included JSP file used

    Dick Weisinger Newbie

      The following file creates a cookie when called alone, but when this file is included in another JSP, the cookie doesn't survive.
      Is this a bug in the JBoss App server, or is there configuration or code that I can use to get it to work?


      <%@ page contentType="text/html" %>
      <jsp:directive.page import="javax.servlet.http.Cookie"/>
       Cookie c = new Cookie("NewCookie","Data for Cooki");
       out.println(c.getName()+": "+c.getValue()+"<br/>");

      It fails though when included in this JSP page:

      <%@ page contentType="text/html" %>
      <jsp:include page="./cookietest.jsp" flush="true"/>
      <center><b>JSP Test</b></center>