public class CookieUtil
extends java.lang.Object
构造器和说明 |
---|
CookieUtil() |
限定符和类型 | 方法和说明 |
---|---|
static java.lang.String |
getCookieValue(java.lang.String cookieName,
javax.servlet.http.HttpServletRequest request) |
static void |
removeCookie(java.lang.String cookieName,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
设置 Cookie 信息 by gk
|
static void |
setCookie(java.lang.String cookieName,
java.lang.String cookieValue,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
设置 Cookie 信息
|
static void |
setCookie(java.lang.String cookieName,
java.lang.String cookieValue,
int expiry,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
public static java.lang.String getCookieValue(java.lang.String cookieName, javax.servlet.http.HttpServletRequest request)
public static void setCookie(java.lang.String cookieName, java.lang.String cookieValue, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
cookieName
- 名称cookieValue
- 值request
- 请求对象response
- 响应对象public static void setCookie(java.lang.String cookieName, java.lang.String cookieValue, int expiry, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
cookieName
- cookie名称cookieValue
- cookie值expiry
- 有效时间(机构:秒),如果参入的expiry 小于 0, 则有效时间设置为0request
- 请求对象response
- 响应对象public static void removeCookie(java.lang.String cookieName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
cookieName
- 名称request
- 请求对象response
- 相应对象