Uh....even if it's just a "for-this-session" cookie, you still need to:
// check...are there cookies already set-up for this site / path ?
Cookie [] cookies = request.getCookies();

if they don't exist for the domain, (cookies.length=0) then:
// create a new one
Cookie info = new Cookie("cookie_name","");
// add some data
String stingval = "here is some cookie data - strings only !";
info.setValue(stringval);
// make sure it's accessible from all paths
info.setPath("/");
// lets save it ! - note: this cookie will disappear when the browser is
closed
response.addCookie(info);


I think the putValue is establishing some sort of session object - totally
unrelated to COOKIES.
Also, remember: Netscapes' implementation of cookies is totally distinct
from IE's !!

> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Corey A. Johnson
> Sent: Wednesday, June 28, 2000 2:39 PM
> To: [EMAIL PROTECTED]
> Subject: Sessions/Cookies do not work in IE5!!!!!!
>
>
> Hello all,
>
> I am at my wits end...  I just got off the phone with iPlanet...  they
> are now telling me that i have to call their Professional Services
> department... because support can not help me.. I AM LOSING MY MIND!
>
> I am using a Solaris 7 SPARC install of iPlanet Web Server 4.1 SP1.
>
> I am trying to simply get Sessions/Cookies to work in Internet Explorer
> 5.  I am setting a session in a JSP file:
>
> <%
> session = request.getSession(true);
> session.putValue("Test", "Test Value");
> %>
>
> I have done this hundreds of times in the past.
>
> All works fine with a Netscape browser... but the session will not set
> in IE...
>
> I have tried everything, including:
>
> 1) Checking date/time on my system and the server.
> 2) Testing has been done on 10 different desktops.. same results.
> 2) Wrote a test servlet instead of a JSP page... did not work either...
> (i know.. i know.. but it was worth i try!!)
> 3) I tried the EXACT same thing on my Apache/Linux system.. WORKS
> FINE!!! In both browsers.
> 4) Tried it on one of our SGI boxes running iPlanet Web Server 4.0..
> DID NOT WORK in IE, but works in Netscape....
>
> Am i going crazy?  I can not believe this is isolated to me and my
> servers...  it must be something simple....
>
> Any help/advice would be so much appreciated...
>
> Thanks everyone..  i am going to go shopping for a gun now!!  To shoot
> myself with!!  ;-)
>
> Cj
> --
> Corey A. Johnson
> Creative Network Innovations, Inc.
> 1-800-264-5547 ** 1-407-259-1984
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to