i'm experiencing bizarre behaviour with cookies.  I set a cookie named "a" in
one servlet, and a
cookie called "b" in another.  They each have a maximum age of about a year.
It seems though, that setting one deletes the other.  I've looked at the
tutorial and the API and it would seem i'm doing everything right. So whenever
"b" gets set, "a" is not available at the next request, and vice-versa.

here's the code I'm using for setting a cookie :

                                Cookie c = new Cookie("dounoreferedby", referedby);
                                c.setMaxAge(31536000);
                                c.setComment("Tracking who referred you to Douno");
                                res.addCookie(c);

and the code for getting it

                Cookie[] cookies = req.getCookies();
                for(int i = 0; i < cookies.length; i++)
                {
                        Cookie c = cookies[i];
                        if(c.getName().equals("dounoreferedby"))
                                referedby = c.getValue();
                }

is there anything i'm missing?

thanks

dan

___________________________________________________________________________
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