You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
829 B

package ${basePackage}.frame.utils;
6 years ago
import javax.servlet.http.Cookie;
/**
* CookieUtil
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class CookieUtil {
/**
* Cookies
*
* @param cookies Cookies
* @return passportID
*/
public static String getCookieValue(Cookie[] cookies, String key) {
if (cookies != null) {
for (Cookie cookie : cookies) {
// Cookie中存放的为passport的id Cookie名称通过ConfigToolObject获取
if (cookie != null && cookie.getName().equals(key)) {
try {
return cookie.getValue();
} catch (Exception ignored) {
}
}
}
}
return null;
}
}

Powered by TurnKey Linux.