Bug 19776 - addcookie tag forget to set the path of the cookie
Summary: addcookie tag forget to set the path of the cookie
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Response Taglib (show other bugs)
Version: 1.0.1
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2003-05-08 19:59 UTC by Christophe.Lestienne
Modified: 2005-09-24 09:13 UTC (History)
1 user (show)



Attachments
Patch to resolve this issue. (581 bytes, patch)
2003-12-09 07:36 UTC, Martin Cooper
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe.Lestienne 2003-05-08 19:59:29 UTC
The example given in the doc does not work. The path is never set in the cookie

<res:addCookie name="test">
 <res:value>Yes</res:value>
 <res:path>/response-examples/</res:path>
</res:addCookie>

The cause is to be found in the AddCookieTag.java. Have a llok at the doEndTag()
method, you'll find a missing line!


public final int doEndTag() throws JspException
    {
	// Set the cookie attribute values
	if( value != null )
	    cookie.setValue(value);
	if( comment != null )
	    cookie.setComment(comment);
	if( domain != null )
	    cookie.setDomain(domain);
--->	cookie.setPath(path);
	cookie.setMaxAge(maxAge);
	cookie.setSecure(secure);
	cookie.setVersion(version);
	// Add the cookie
	((HttpServletResponse)pageContext.getResponse()).addCookie(cookie);

	return EVAL_PAGE;
    }


          
Could you please correct this?

Thank you!

Cheers

Christophe
Comment 1 Martin Cooper 2003-12-09 07:36:43 UTC
Created attachment 9459 [details]
Patch to resolve this issue.
Comment 2 Rahul Akolkar 2005-09-24 17:13:58 UTC
I've applied the patch since one was available and verified.

However, the response taglib has been deprecated, we do not expect any 
development around it in the near future. Please switch to the using JSTL, if 
possible.