|
static Cookie | getCookie (HttpServletRequest request, String name) |
|
static void | setCookie (HttpServletResponse response, String name, String value, String path, int age) |
|
static void | deleteCookie (HttpServletResponse response, String name, String path) |
|
static void | encryptCookie (HttpServletResponse response, String name, byte[] value, String path, int age) |
|
static byte[] | decryptCookieValue (Cookie cookie) throws IOException, DecoderException |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 32 of file CookieUtil.java.
◆ decryptCookieValue()
static byte [] org.turro.elephant.impl.util.CookieUtil.decryptCookieValue |
( |
Cookie |
cookie | ) |
throws IOException, DecoderException |
|
static |
Definition at line 69 of file CookieUtil.java.
70 return cookie ==
null ? null :
new Base64().decode(cookie.getValue().getBytes());
◆ deleteCookie()
static void org.turro.elephant.impl.util.CookieUtil.deleteCookie |
( |
HttpServletResponse |
response, |
|
|
String |
name, |
|
|
String |
path |
|
) |
| |
|
static |
Definition at line 53 of file CookieUtil.java.
54 Cookie cookie =
new Cookie(name,
null);
57 response.addCookie(cookie);
◆ encryptCookie()
static void org.turro.elephant.impl.util.CookieUtil.encryptCookie |
( |
HttpServletResponse |
response, |
|
|
String |
name, |
|
|
byte[] |
value, |
|
|
String |
path, |
|
|
int |
age |
|
) |
| |
|
static |
Definition at line 60 of file CookieUtil.java.
61 Cookie cookie =
new Cookie(name,
new String(
new Base64().encode(value)));
62 if(ElephantContext.getUseSSL()) cookie.setSecure(
true);
65 cookie.setMaxAge(age);
66 response.addCookie(cookie);
◆ getCookie()
static Cookie org.turro.elephant.impl.util.CookieUtil.getCookie |
( |
HttpServletRequest |
request, |
|
|
String |
name |
|
) |
| |
|
static |
Definition at line 36 of file CookieUtil.java.
37 Cookie[] cookies = request.getCookies();
38 if(cookies ==
null)
return null;
39 for(
int i = 0; i < cookies.length; i++)
40 if(cookies[i].getName().equals(name))
◆ setCookie()
static void org.turro.elephant.impl.util.CookieUtil.setCookie |
( |
HttpServletResponse |
response, |
|
|
String |
name, |
|
|
String |
value, |
|
|
String |
path, |
|
|
int |
age |
|
) |
| |
|
static |
Definition at line 45 of file CookieUtil.java.
46 Cookie cookie =
new Cookie(name, value);
47 if(ElephantContext.getUseSSL()) cookie.setSecure(
true);
49 cookie.setMaxAge(age);
50 response.addCookie(cookie);
The documentation for this class was generated from the following file: