Hi,
I  am working with WeblogicServer5.1.
my JSP can not set the cookie to the client
My JSP  use   MonMdaCookie  Bean where I am using two methods:
one for computing cookie and the second to send  them to the Client but it
's not  work

Can someone help me?

this method would  send the cookie to Client
public void writeCookie(HttpServletRequest httpServletRequest,
                            HttpServletResponse httpServletResponse,
                            String uid, String realm, String cargo)
      throws IOException {
        long ti = (new Date()).getTime()/1000;
        file://ti=968761186;
        Cookie cookie = new Cookie(cookieName, cookieName);
        cookie.setValue(
          computeCookieString(httpServletRequest.getRemoteAddr(),
                              uid,realm,cargo,ti,null));

        cookie.setDomain(domain);
        cookie.setComment("mailto:[EMAIL PROTECTED]");
        cookie.setMaxAge(maxLifeTime);
        cookie.setPath("/");
        cookie.setSecure(secureCookie);
        httpServletResponse.addCookie(cookie);
    }



this is my jsp
       .........
        usr_realm=loginBean.getGroupe();
          usr_id=loginBean.getUsername

        MonMdaCookie c=new MonMdaCookie();
          // on calcule le cookie corespondant%>

Moncookie=<%=c.computeCookieString(IP,usr_id,usr_realm,cargo,12334,null)%>

          <%
          // Ecriture cu cookie chez le client
          c.writeCookie(request,response,usr_id,usr_realm



Thanks for help

Martin

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to