I had this problem also. The cookie path and domain seemed to have been set
in such a way that the cookie was not "seen" buy the redirected-to page.

I added setPath and setDomain like this:

    Cookie c = new Cookie("rememberme", "checked");
    c.setMaxAge(24*365*60*60);
    c.setPath("/");
    c.setDomain(".cafepress.com");
    response.addCookie(c);


and the problem was solved....


-fred



> I am having the same problem as below.  I set a cookie on login, then
> redirect to the appropriate page without even writing a single line to the
> output stream and the cookie does not get set.  Is there any way to get
> around this?
>
> Travis
>
> On Mon, 17 Apr 2000 08:10:21 -0400, Jerry Denman <[EMAIL PROTECTED]>
wrote:
>
> >Without seeing your code I can only make a guess - all cookie operations
> >typically must take place within the <HEAD></HEAD> tags.  Most often the
> >cookie will not set if done in any other portion of the HTML code.
> >
> >Hope that helps
> >
> >Jerry M Denman
> >Management Information Consulting
> >
> >-----Original Message-----
> >From: Mr. Srinivas Rao [mailto:[EMAIL PROTECTED]]
> >Sent: Monday, April 17, 2000 7:54 AM
> >To: [EMAIL PROTECTED]
> >Subject: JSP query with cookies setting
> >
> >
> >hi,
> >I am facing very strange problem that is I am using jsp with tomcat web
> >server.
> >
> >I am trying to add certain cookies on certain conditions.  I am able to
do
> >it as per my wish if I just let the page go on its flow..but if i am
trying
> >to redirect the page after adding the cookie, it wont add the cookie
> >althought redirecting the page properly and doing all other things in the
> >required manner.
> >
> >Please try to find the solution and mail me..
> >
> >Regards
> >
> >ES Rao
>
> Travis Reeder
> Director, Internet Technologies
> Xabre.com
>
>
===========================================================================
> 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