"Boemio, Neil (CAP, FGI)" wrote:
>
> If I have xxx.com and yyy.com both going to aaa.com, how can I retrieve a
> cookie for aaa.com when any of these are visited.
>
> So when someone visits xxx.com, I want to be able to retrieve it from under
> aaa.com because that's where my servlet put it since I use
> request.getServerName() when setting the cookie.
>
> If I use request.getCookies(), it tries to get it from where the user
> visited .... example xxx.com or yyy.com .... but it's not there.  It will
> always be under aaa.com.

As has been well answered in other posts, you can't do what you're asking: If
the cookie is set by xxx.com, the browser will not return the cookie to yyy.com.
(Although I do remember seeing a bug report recently that would cause the
browser to send any cookie to any server. (http://www.cookiecentral.com) But of
course, you should not rely on a bug to do what you wish.)

One possible solution is to use the cookie to store a user id that is the same
for a single user for all domains. Keep the information needed by all servers in
a persistent store that is available to all three servers.

A related possible solution is to have all page requests to other domains,
access the "primary" domain as well. If any page that is served from www.aaa.com
or www.bbb.com, includes a URL that fetches some part of the page from
www.fgic.com (like a small graphic), then the browser will return the cookie to
www.fgic.com. (You can get a more detailed explantion of this from
http://photo.net/wtr/thebook/user-tracking.html, look for the section that
starts with "I want to know the age, sex, and zip code of every person who
visited my site so that I can prepare a brochure for advertisers.") The last
thing you'd have to figure out is how to share the information stored at
www.fgic.com with other servers.

Kevin Mukhar

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to