You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Thibault Kruse (JIRA)" <ji...@apache.org> on 2014/07/18 16:11:04 UTC

[jira] [Created] (WICKET-5648) Extend CookieUtils API

Thibault Kruse created WICKET-5648:
--------------------------------------

             Summary: Extend CookieUtils API
                 Key: WICKET-5648
                 URL: https://issues.apache.org/jira/browse/WICKET-5648
             Project: Wicket
          Issue Type: Improvement
            Reporter: Thibault Kruse
            Priority: Minor


Hi, not sure even whether CookieUtils is supposed to be used outside wicket. But if so, it has some API flaws.

The CookieUtils class has 

public final void save(String key, final String... values)

but no *public* load method to load the saved multiple values. Clients can load the whole string and split themselves, but that's dirty. And using FormComponent.VALUE_SEPARATOR seems wicket-specific anyway (and is not safe against values with that separator), so maybe that method should be protected, not public.

The code

cookie.setSecure(false);

in save() also seems dodgy, but seems to have no effect (defaultSettings still work).

Finally it is a bit weird that there is no access to the underlying Cookie itself, with it's getDomain() etc methods. For Developers it might be nice to work with the cookie avoiding the boilerplate code, so maybe getCookie() could be made public instead of private



--
This message was sent by Atlassian JIRA
(v6.2#6252)