Hi Christopher,

    I'm not sure what's difference of JSESSIONID cookies and
javax.servlet.http.Cookie,
    I think they are the same thing right? or some other difference details
what I don't know.

    when a client user click logout link from the main site web page, 
    the logout link is main site's logout Servlet URL, and the logout
Servlet will do something as following:
    1. set the cookies maxAge to 0 and add them into response again.
        cookie.setMaxAge(0);
        response.addCookie(cookie);
    2. set the session to invalidate
        request.getSession().invalidate();
    3. response.sendRedirect(redirectTo); redirectTo is the URL of second
site's logout link.
    then the client browser will redirect to second site's logout URL, and
it is a Struts Action,
    and this logout Action will do something as following:
    1.  set the session to invalidate
    2.  set the cookie maxAge to 0 and add them into response again.
        cookies[i].setMaxAge(0);
        response.addCookie(cookies[i]);
    3.  forward to a logout default display page.
    4.  direct to main site some page by form submit in default logout
display page.

    then done this logout process,
    and I found the cookie of main site was be removed but the second site
did not!
    when I use the same browser instance to visit second site's logout, and
the cookies 
    of second site still did not be removed! but, if I open a new browser
and to visit 
    the second site's logout then the cookies of second could be removed!

    I need give user a single link to finish the main and second site's
logout, 
    so I try to do what I did, but it did not work like what I want!
    do I do something wrong and can you give me some idea to do that or some
other 
    useful information.

Thank you for your help~
Bon


Christopher Schultz-2 wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Bon,
> 
> Bon wrote:
>> In my environment there are two tomcat server runing with different 
>> port in one server , and both two must set its own cookies into 
>> client
> 
> Are you talking about JSESSIONID cookies, or some other ones?
> 
>> now, when I open a browser and browe both site and I can find two
>> site write their own cookie into my computer, but when I logout from
>> both two sites
> 
> How do you logout from these sites?
> 
>> (they will expire their own cookies)
> 
> How do they expire their cookies?
> 
>> with same browser, but the cookies of on site did not be removed,
>> does anyone know what is it going on? and how can I solve this
>> problem?
> 
> Are you observing the cookies being re-sent to the server after they
> should have been expired, or are you seeing them listed in your
> browser's active cookie list?
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkkTS5oACgkQ9CaO5/Lv0PCbMQCdHj/qRoGswA1/gOf1FE4ULb/m
> A5sAn1jPlSAVxOR9PPYRIGMoqWZ/+zOe
> =/EoB
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/a-cookie-question-of-one-Server-with-two-tomcat-server-tp20355052p20373498.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to