>>>What servlet engine are you using, you never said?
        >>>
        I am using the mini web server that comes with jsdk2.0
        sun.servlet.http.HttpServer class
        (I am on Solaris 2.51 on a Sparc 1000 m/c)

        >>>>And how are you going to be able to use your own getCookies,
since it's part of the servlet engine's HttpServletRequest implementation?)
        >>>

        Well, I do it like this

        HttpSession ss = MyClass.getSession(req);
        (so, I parse the cookies myself!! from the http header)

        I have no choice about the cookies.
        my domain is a.b.foo.com and so genius is setting cookies with a
domain of '.foo.com'
        so I inherit ALL his cookies. Since he has a cookies with a value of
xx=somethingdsfsj
        I get bitten by the getCookies() bug in JSDK

        My workaround works, so i am happy. When Sun gets around to fixing
getCookies(), I  will junk my classes

        --Olu E.


> -----Original Message-----
> From: Milt Epstein [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, June 25, 1999 12:40 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: Zero length array!
>
> On Fri, 25 Jun 1999, Emuleomo, Olu (PME) wrote:
>
> >         >>>>Are you getting any IllegalArgumentException's?
> >
> > No! No exceptions! req.getCookies() just returns a zero length array!!
> > I am currently in the process of crafting MY OWN getCookies(req)
> > that sidesteps this problem.
> > I've got clients screaming that their stuff does not work!... :-((
>
> Hmmmm, that's interesting.  I wonder if the getCookies implementation
> is perhaps catching those exceptions.  What servlet engine are you
> using, you never said?  (And how are you going to be able to use your
> own getCookies, since it's part of the servlet engine's
> HttpServletRequest implementation?)
>
> A couple of comments:
>
> 1. You might pass this info on to the servlet engine vendor, it might
>    be indicative of a problem in it (and/or perhaps the JSDK still has
>    a problem)
>
> 2. You might think about not using cookies which have an '=' (or any
>    of the other restricted characters) in their value.  This might
>    cause some pain in the short run, but may be easier in the long
>    run.
>
>
> > > -----Original Message-----
> > > From: Milt Epstein [SMTP:[EMAIL PROTECTED]]
> > > Sent: Thursday, June 24, 1999 3:57 PM
> > > To:   [EMAIL PROTECTED]
> > > Subject:      Re: Zero length array!
> > >
> > > On Thu, 24 Jun 1999, Emuleomo, Olu (PME) wrote:
> > >
> > > > Actually, I have found the Bug!!!
> > > > The problem is this.
> > > > The user agent (Netscape 4.6) is sending me 2 cookies.
> > > > One called  "SITEFOO"   value    "ID=abcdefg"
> > > > and another, the session cookie with value "somevaluefof"
> > > > Now, req.getCookies() returns a ZERO LENGTH array because the value
> in
> > > the
> > > > 1st cookie (ID=abcdefg) contains an equals sign!!! (=)
> > > > Now, If i shutdown the browser and I edit the cookies file and
> change
> > > the
> > > > cookie value to ID1abcdefg (ie, I replace the = sign with a 1)
> > > > EVERYTHING WORKS fine!
> > > >
> > > > So, the bug is in req.getCookies()
> > >
> > > Well, depending on what version of cookies you're using, certain
> > > characters are not allowed in cookie values.  I had a problem with
> > > this some time back.  By Netscape's original spec (version 0), most
> > > characters are allowed (with the exception of a few, like ' ' and ',',
> > > I don't recall exactly).  With the new cookie spec (RFC 2109, version
> > > 1), there are many more disallowed characters, including "=" (the
> > > restrictions amount to saying that the cookie value must be a valid
> > > HTTP 1.1 "token").  Technically, the JSDK was supposed to allow
> > > cookies of both types (and even had a "version" parameter), but it did
> > > have some problems with that -- it would throw
> > > IllegalArgumentException's when encountering cookies with the
> > > disallowed characters.  If you take a look at the Cookie.java source,
> > > you can see all this.  Although, I don't know whether this problem has
> > > been addressed in more recent JSDK versions.  Are you getting any
> > > IllegalArgumentException's?
> > >
> > >
> > > > > -----Original Message-----
> > > > > From: Chris Pratt [SMTP:[EMAIL PROTECTED]]
> > > > > Sent: Wednesday, June 23, 1999 10:58 PM
> > > > > To:   [EMAIL PROTECTED]
> > > > > Subject:      Re: Zero length array!
> > > > >
> > > > > Not according to the documentation.  It doesn't say anything about
> > > > > getCookies returning null, so I'd assume it should return a Zero
> > > Length
> > > > > Array.
> > > > >     (*Chris*)
> > > > >
> > > > > ----- Original Message -----
> > > > > From: Emuleomo, Olu (PME) <[EMAIL PROTECTED]>
> > > > > To: <[EMAIL PROTECTED]>
> > > > > Sent: Wednesday, June 23, 1999 3:49 PM
> > > > > Subject: Zero length array!
> > > > >
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Does anybody know why req.getCookies() returns a zero length
> array?
> > > > > > ie. Cookies ck[] = req.getCookies();
> > > > > >
> > > > > > ck.length == 0 !!
> > > > > > I am trying to list the cookies in a HttpServletRequest.
> > > > > > If there are no cookies present, shouldnt it return null?
> > > > > >
> > > > > > --Olu E.
> [ ... ]
>
> Milt Epstein
> Research Programmer
> Software/Systems Development Group
> Computing and Communications Services Office (CCSO)
> University of Illinois at Urbana-Champaign (UIUC)
> [EMAIL PROTECTED]
>
> __________________________________________________________________________
> _
> 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

Reply via email to