Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Cookies failing in Java servlets in OAS 4.0.8

Cookies failing in Java servlets in OAS 4.0.8

From: Noel O'Brien <noel_at_paragon.ie>
Date: Mon, 29 Nov 1999 19:27:47 -0000
Message-ID: <QqA04.2419$o4.1512@news.indigo.ie>

I am unable to get cookies to work when writing Java servlets in OAS 4.0.8. I have tried using the
addCookie method

if the addCookie is put after setContentType, the cookies.txt file timestamp gets updated, however, no data goes in there. Have I configured something wrong?
Or is it a programming error

this is a work around we have been working on...

        .........
 PrintWriter out = new PrintWriter (response.getOutputStream());

        file://not functional: response.addCookie(new Cookie("psa_user", cookie_value));

        out.println("Content-type: text/html");
        out.println("Set-Cookie: psa_user="+cookie_value+";
expires="+tomorrow);
        file://out.println("Set-Cookie: BOYAN=BONTCHEV; expires=27-Nov-99
GMT");
        file://out.println("Set-Cookie: EMMETT=McCarrol; expires=20-Nov-98
GMT");
        out.println();
        out.println("<html>");

...........

Workaround of method getCookies:

      String allCookies = request.getHeader("cookie");

, and then parse this string (allCookies).

..........

sometimes it does not write the cookie on local disk and sometimes it will not retrieve cookie.

have tested in IE 5.0 , 5.01 and not working .

our workaround will work in Netscape Navigator though.

any body got any ideas at all ?

--
Noel O'Brien
Senior Technical Consultant

Paragon Group                                          Direct Tel: 353 1
8330687
The Village Centre                                     Fax: 353 1 8330671
165-169 Howth Road                                Mobile: 086 8210308
Killester
Dublin 3
Ireland Received on Mon Nov 29 1999 - 13:27:47 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US