You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ol...@sk-koeln.de on 2002/09/16 11:15:19 UTC

Apache2 + Tomcat4.1.10 + coyote + jk2 + cookies + winNT

Hi all,

we are using the above depicted configuation and I have difficulties in
receiving more than one cookie.

The existing application, which works fine with apache1.3 + tc4.0 and jk1
sends back two cookies for the same domain but with different keys.
Both cookies are valid for the current session only.

The code fragment looks like the following:

if ( userAuthorized_KIB ) {
          cookie = new Cookie (COOKIE_KEY_KIB, user);
          cookie.setMaxAge(-1);
          cookie.setPath("/");
          cookie.setDomain(COOKIE_DOMAIN);
          res.addCookie(cookie);
          System.out.println("Cookie KIB set");
        }
          if ( userAuthorized_FS ) {
          cookie = new Cookie(COOKIE_KEY_FS, user);
          cookie.setMaxAge(-1);
          cookie.setPath("/");
          cookie.setDomain(COOKIE_DOMAIN);
          res.addCookie(cookie);
          System.out.println("Cookie FS set");
        }

I always get back the last written cookie only. Here in the above example
the FS cookie.
If  I change the code (the KIB cookie is set last) I'll get back the KIB
cookie only.

Any comments appreciated.

Thanx
Oliver

Oliver Lauer
Stadtsparkasse Köln
512 / BK / Anwendungsentwicklung
Telefon: (0221) 226 - 5562
Fax: (0221) 226 - 5100
mailto:Oliver.Lauer@sk-koeln.de
http://www.sk-koeln.de
Da E-Mails leicht unter fremdem Namen erstellt oder manipuliert werden
koennen, muessen wir zu Ihrem und unserem Schutz die rechtliche
Verbindlichkeit der vorstehenden Erklaerungen ausschliessen. Die fuer die
Stadtsparkasse Koeln geltenden Regeln ueber die Verbindlichkeit von
rechtsgeschaeftlichen Erklaerungen mit verpflichtendem Inhalt bleiben
unberuehrt.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Apache2 + Tomcat4.1.10 + coyote + jk2 + cookies + winNT

Posted by Milt Epstein <me...@uiuc.edu>.
On Mon, 16 Sep 2002 Oliver.Lauer@sk-koeln.de wrote:

> Hi all,
>
> we are using the above depicted configuation and I have difficulties in
> receiving more than one cookie.
>
> The existing application, which works fine with apache1.3 + tc4.0 and jk1
> sends back two cookies for the same domain but with different keys.
> Both cookies are valid for the current session only.
>
> The code fragment looks like the following:
>
> if ( userAuthorized_KIB ) {
>           cookie = new Cookie (COOKIE_KEY_KIB, user);
>           cookie.setMaxAge(-1);
>           cookie.setPath("/");
>           cookie.setDomain(COOKIE_DOMAIN);
>           res.addCookie(cookie);
>           System.out.println("Cookie KIB set");
>         }
>           if ( userAuthorized_FS ) {
>           cookie = new Cookie(COOKIE_KEY_FS, user);
>           cookie.setMaxAge(-1);
>           cookie.setPath("/");
>           cookie.setDomain(COOKIE_DOMAIN);
>           res.addCookie(cookie);
>           System.out.println("Cookie FS set");
>         }
>
> I always get back the last written cookie only. Here in the above example
> the FS cookie.
> If  I change the code (the KIB cookie is set last) I'll get back the KIB
> cookie only.

Well, here's the obvious stuff: Are COOKIE_KEY_KIB and COOKIE_KEY_FS
distinct values?  Are you sure both userAuthorized_KIB and
userAuthorized_FS are true?  At what point in the processing of the
response are you doing this?

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>