there is minor issue with current CookiesImpl.removeCookieValue
implementation.


> public void removeCookieValue(String name)
>     {
>         Cookie cookie = new Cookie(name, null);
>         cookie.setPath(request.getContextPath() + "/");
>         cookie.setMaxAge(0);
>         cookie.setSecure(request.isSecure());
> 
>         cookieSink.addCookie(cookie);
>     }
> 

 When you write a cookie value, you can set additionally domain and path.
But when you delete a cookie, the path is always set to
request.getContext()+"/". So that, cookies saved with the path different
from context+"/" are never deleted.
i suggest that when removeCookieValue is called, the path and domain values
are retrieved from original cookie (if it is present, else there is no point
to do anything since cookie is absent).
smth like


> public void removeCookieValue(String name) {
> Cookie[] cookies = cookieSource.getCookies();
> 
> if (cookies != null) {
>     for (Cookie originalCookie: cookies) {
>             if (originalCookie.getName().equals(name)) {
>                  Cookie cookie = new Cookie(name, null);
>                  cookie.setPath(originalCookie.getPath());
>                  cookie.setDomain(originalCookie.getDomain())
>                  cookie.setMaxAge(0);
>                  cookie.setSecure(request.isSecure());
> 
>                  cookieSink.addCookie(cookie);
>             }
>     }
> }
> }
> 

any opinions ?
-- 
View this message in context: 
http://old.nabble.com/-T5.1--Cookies.removeCookieValue-issue-tp28503801p28503801.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to