You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Dhaliwal, Pritpal (HQP)" <Pr...@rhi.com> on 2004/03/02 21:00:02 UTC

RE: How do I get a cookie under a different path within the same domain with bean:cookie tag?

Some cookie spec says:

The path attribute is used to specify the subset of URLs in a domain for
which the cookie is valid. If a cookie has already passed domain matching,
then the pathname component of the URL is compared with the path attribute,
and if there is a match, the cookie is considered valid and is sent along
with the URL request. The path "/foo" would match "/foobar" and
"/foo/bar.html". The path "/" is the most general path. 
If the path is not specified, it as assumed to be the same path as the
document being described by the header which contains the cookie.

So, YES it is possible. Just set the cookies for the domain  www.abcd.com
and to path /, and you should be able to get cookies from every page under
www.abcd.com, You can actually make it more general by specifying the domain
abcd.com, and now www2.abcd.com can access the cookies too. 

BTW, the spec I read was :
http://wp.netscape.com/newsref/std/cookie_spec.html , it might be old but it
made sense..

HTH,
Pritpal Dhaliwal

-----Original Message-----
From: Lee, Yau-Pang [mailto:yaupang.lee@citigroup.com] 
Sent: Tuesday, March 02, 2004 11:18 AM
To: 'Struts Users Mailing List'
Subject: How do I get a cookie under a different path within the same domain
with bean:cookie tag?


Is it possible to retrieve the cookie at: www.abcd.com/cookie/path

from www.abcd.com/another/path

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org