Name
CookieUtils
Synopsis
The CookieUtils
class contains a number of static methods
that can be used to work with javax.servlet.Cookie
objects.
Synopsis
Class name: |
com.ora.jsp.util.CookieUtils |
Extends: |
None |
Implements: |
None |
Methods
-
public static String getCookieValue(String name, javax.servlet.http.HttpServletRequest req)
Returns the value of the Cookie with the specified name, or
null
if not found.-
public static boolean isCookieSet(String name, javax.servlet.http.HttpServletRequest req)
Returns
true
if a cookie with the specified name is present in the request.-
public static void sendCookie(String name, String value, int maxAge, javax.servlet.http.HttpServletResponse res)
Creates a
Cookie
with the specified name, value and max age, and adds it to the response.
Get JavaServer Pages, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.