tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: cookies
Date Mon, 06 Aug 2007 17:55:19 GMT
Hash: SHA1

Tony, wrote:
> He has something called login.html which uses a compiled
> program to set a cookie (response.addCookie( "UserLevel", "value") )
> which adds a cookie called UserLevel with a value retrieved from
> logging in. His other java code does a request.getCookies() and goes
> through the cookies to find "UserLevel" from which he then gets the
> values.

That sounds pretty standard. You ought to be able to replicate this
capability pretty easily.

> My code does the same thing, does
> getCookies[] and looks for "UserLevel". Problem is, it does not find
> it. When I do the Edit->Preferences->"Show Cookies", UserLevel is
> there with the correct value, but all my java jsp code can find is
> the session ID.

Can you post your "cookie finding" code? Also, post the portion of your
(new) code that /sets/ the cookie. Often, cookie-related issues are tied
to incorrect setting of the "path" of the cookie. Also, are you using
SSL at all? If so, please describe any changes from/to SSL requests
during this process.

> Does anyone know what I am doing wrong, or how I can get the
> recently-added cookie?
> I am using firefox.

Oh, good. There are several tools available for ff that are useful in
this regard. LiveHTTPHeaders is an add-on that allows you to snoop the
request and response headers of HTTP transactions. Once installed, you
can just open a LiveHTTPHeaders window and then go through your login
process. You can see the headers for all page requests until you clear
the buffer, so you can verify that, at least, the cookies are being sent

- -chris
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message