us.careydevelopment.util.api.cookie.CookieUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-util Show documentation
Show all versions of api-util Show documentation
Convenience methods for routine API-related tasks
The newest version!
package us.careydevelopment.util.api.cookie;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
public class CookieUtil {
public static void expireCookie(String cookieName, HttpServletResponse response) {
final Cookie cookie = new Cookie(cookieName, "");
cookie.setMaxAge(0);
cookie.setHttpOnly(true);
cookie.setPath("/");
cookie.setSecure(true);
response.addCookie(cookie);
}
}