Package com.oorian.html
Class Cookies
java.lang.Object
com.oorian.html.Cookies
Manages HTTP cookies for an Oorian page session.
This class provides convenient access to request cookies and methods for creating new cookies on the response. Cookie values are refreshed on each AJAX request to stay synchronized with the client.
- Since:
- 2007
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfinal OorianCookieaddCookie(OorianCookie cookie) Adds a pre-configured cookie to the response.final OorianCookieCreates and adds a secure, HTTP-only cookie with the specified name and value.final OorianCookieReturns the cookie with the specified name, or null if not found.final OorianCookieReturns the cookie with the specified name, creating one with the default value if not found.final List<OorianCookie> getAll()Returns all cookies from the current request.
-
Method Details
-
getAll
Returns all cookies from the current request.- Returns:
- A list of all cookies.
-
get
Returns the cookie with the specified name, or null if not found.- Parameters:
name- The cookie name.- Returns:
- The matching cookie, or null if no cookie with that name exists.
-
get
Returns the cookie with the specified name, creating one with the default value if not found.- Parameters:
name- The cookie name.defaultValue- The value to use if the cookie does not exist.- Returns:
- The existing cookie, or a newly created cookie with the default value.
-
addCookie
Adds a pre-configured cookie to the response.- Parameters:
cookie- The cookie to add.- Returns:
- The cookie that was added.
-
addCookie
Creates and adds a secure, HTTP-only cookie with the specified name and value.- Parameters:
name- The cookie name.value- The cookie value.- Returns:
- The newly created cookie.
-