public class CookieUtil extends Object
| Constructor and Description |
|---|
CookieUtil() |
| Modifier and Type | Method and Description |
|---|---|
static javax.servlet.http.Cookie |
getCookie(javax.servlet.http.HttpServletRequest request,
String name)
Gets a cookie
|
static String |
getCookieValue(javax.servlet.http.HttpServletRequest request,
String name)
Returns the value of a cookie if present
|
static void |
setCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value,
String path,
int expirySeconds,
boolean secure,
String domain)
Sets a cookie
|
public static javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest request,
String name)
request - the HttpServletRequestname - the name of the cookiepublic static String getCookieValue(javax.servlet.http.HttpServletRequest request, String name)
request - the HttpServletRequestname - the name of the cookiepublic static void setCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value,
String path,
int expirySeconds,
boolean secure,
String domain)
response - the HttpServletResponsename - the name of the cookievalue - the value of the cookiepath - the patch of the cookieexpirySeconds - the expiry time of the cookie in secondssecure - indicating if it has to be securedomain - the domain on which the cookie has to be setCopyright © 2019–2021 personify. All rights reserved.