Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Cookies failing in Java servlets in OAS 4.0.8
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 8210308Killester