Have you tried the FAQ? Specifically question 39?
----- Original Message -----
From: Michael Parcewski <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 04, 2000 5:11 AM
Subject: Cookies
> I've checked everywhere else and have come up empty, so I'll try here.
>
> here's my problem, we do some branding on our site and we wanted to use
> cookies to persist branding when users return to the site.
>
> We decided, since there's no other way, to use cookies, but I'm having a
> problem. I can set the cookie, but can't disable it. Take a look at the
> code below, and see if you can help me out.
>
>
> /// This logs in a user and creates a session (session code taken out)
>
> if ("Log-In".equals(request.getParameter("action") {
>
> Cookie c = new Cookie("firstName",
> student.getFirstName());
> c.setMaxAge(364*24*60*60);
> response.addCookie(c);
>
> if
(student.getAffiliation().getPrimaryKey()
> != null) {
>
> Cookie c2 = new Cookie("schoolId",
> student.getAffiliation().getPrimaryKey().toString());
> c2.setMaxAge(364*24*60*60);
> response.addCookie(c2);
> }
>
> // This is supposed to disable cookie (but doesn't)
>
> if ("disable_cookie".equals(request.getParameter("action"))) {
>
> Cookie c3[] = request.getCookies();
>
> for (int i = 0; i < c3.length; i++) {
> out.println("should expire");
> c3[i].setMaxAge(0);
> }
> }
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
---
Richard Vowles, Infrastructure Architect, Inprise New Zealand
home-email: "mailto:[EMAIL PROTECTED], work-email: "[EMAIL PROTECTED]"
"Is it not a foolish man who puts all his chickens down his trousers" -
Alexi Sayle, Panic
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html