public class CookieUitl extends Object
| 构造器和说明 |
|---|
CookieUitl() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addCookie(String name,
String value,
boolean httpOnly,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse response)
添加cookie,cookie的生命周期为关闭浏览器即消失
|
static void |
addCookie(String name,
String value,
int maxAge,
boolean httpOnly,
String domain,
String path,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse response)
添加cookie
|
static void |
delCookie(String name,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
删除cookie
|
static String |
getValueByName(String name,
javax.servlet.http.HttpServletRequest request)
根据cookie名称取得值
|
static boolean |
isExistByName(String name,
javax.servlet.http.HttpServletRequest request) |
public static void addCookie(String name, String value, boolean httpOnly, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse response)
name - value - req - response - public static void addCookie(String name, String value, int maxAge, boolean httpOnly, String domain, String path, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse response)
name - cookie名称value - cookie值maxAge - cookie存活时间req - response - public static void delCookie(String name, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
name - response - public static String getValueByName(String name, javax.servlet.http.HttpServletRequest request)
name - request - public static boolean isExistByName(String name, javax.servlet.http.HttpServletRequest request)
name - request - Copyright © 2018. All rights reserved.