@@ -0,0 +1,1021 @@
+%0D%0Apublic class CookieManager %7B%0D%0A  %0D%0A  private HttpServletResponse response;%0D%0A  private HttpServletRequest request;%0D%0A%0D%0A  public CookieManager(HttpServletRequest request, HttpServletResponse response) %7B%0D%0A    this.request = request;%0D%0A    this.response = response;%0D%0A  %7D%0D%0A%0D%0A  public Cookie getCookie(String key) %7B%0D%0A    for(Cookie c : request.getCookies() ) %7B%0D%0A      if(c.getName().equals(key))%0D%0A        return c;%0D%0A    %7D%0D%0A    return null;%0D%0A  %7D%0D%0A%0D%0A  public String get(String key, String def) %7B%0D%0A    Cookie c = this.getCookie(key);%0D%0A    return c == null ? def : c.getValue();%0D%0A  %7D%0D%0A%0D%0A  public String get(String key) %7B%0D%0A    return this.get(key, null);%0D%0A  %7D%0D%0A%0D%0A  public void add(Cookie c) %7B%0D%0A    response.addCookie(c);%0D%0A  %7D%0D%0A%0D%0A  public void add(String key, String value, int sec) %7B%0D%0A    Cookie c = new Cookie(key, value);%0D%0A    c.setMaxAge(sec);%0D%0A    this.add(c);%0D%0A  %7D%0D%0A%0D%0A  public void add(String key, String value) %7B%0D%0A    this.add(key, value, 3600);%0D%0A  %7D%0D%0A%0D%0A  public void remove(String key) %7B%0D%0A    this.add(key, null, 0);%0D%0A  %7D%0D%0A%7D%0D%0A

add src