it appears the setting maxAge to -1 was the problem. cookie does not get
set with this. set to (24*60*60) and it works
-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 10:39 AM
To: Struts Users Mailing List
Subject: RE: setting cookies from an action?
> From: Menke, John [mailto:[EMAIL PROTECTED]
> i'm trying this in my action and it's not working:
> Cookie myCookie = new Cookie("name", "value");
> response.addCookie(myCookie);
I think you have to set an age, or else it's a memory-only cookie and
will disappear when you close the browser. Is that what you wanted?
Here's what I use:
myCookie.setMaxAge( 2592000 );
(I think it's the number of seconds... Check the API.)
If that's not the problem, can you be more specific about what's not
working?
--
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]