Hi Jochen,
Since you are sending it secure, you might try:
xxxx.setSecure(true); // Change to true when using SSL.
Tom Kochanowicz
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Jochen Vastmans
Sent: Friday, April 14, 2000 7:41 AM
To: [EMAIL PROTECTED]
Subject: Servlet -> Cookie Problem
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
___________________________________________________________________________
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