Hello,

I'm using JavaWebServer 2.0, and I'm trying to send cookies to the client, but I can't 
find them, not
when I'm using NN(under linux .netscape/cookies) not with IE...(windows/cookies)
The cookies are send when the webserver is in secure mode...

This is some code from servlets...
Can someone tell me what is wrong or what the problem is?

Thanks,
Best Regards,

Jochen Vastmans

e-mail: [EMAIL PROTECTED]

// SENDING COOKIES
cookies = req.getCookies();
cust = (Customer)cs.getCustomer();
long cid = cust.getID();
String id = String.valueOf(cid);

if(cookies != null){

  for(int i=0;i<cookies.length;i++){
 if(cookies[i].getName().equals("CID")){
  customerId = (Cookie)cookies[i].clone();
  customerId.setValue(id);
  customerId.setComment("Kuleuven Online Store");
  customerId.setDomain(HOST);
  customerId.setMaxAge(10000000);
  //customerId.setSecure(true);
 }
  }
}

if(customerId == null){
 customerId = new Cookie("CID",id);
 customerId.setValue(id);
 customerId.setComment("Kuleuven Online Store");
 customerId.setDomain(HOST);
 customerId.setMaxAge(10000000);
 //customerId.setSecure(true);
}
res.addCookie(customerId);

// RECIEVING COOKIES
cookies = req.getCookies();
if(cookies != null){
  for(int i=0;i<cookies.length;i++){
 if(cookies[i].getName().equals("CID")){
  c = (Cookie)cookies[i].clone();

  try{
  cid = (long) Integer.valueOf(c.getValue()).intValue();
  break;
  }
  catch(NumberFormatException nfe){}
 }
  }
}

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to