19 package org.turro.marker;
21 import java.util.logging.Level;
22 import java.util.logging.Logger;
23 import javax.servlet.http.Cookie;
24 import javax.servlet.http.HttpServletRequest;
25 import javax.servlet.http.HttpServletResponse;
26 import org.turro.elephant.context.ElephantContext;
27 import org.turro.elephant.impl.util.CookieUtil;
35 private final HttpServletRequest request;
36 private final HttpServletResponse response;
38 public Cookies(HttpServletRequest request, HttpServletResponse response) {
39 this.request = request;
40 this.response = response;
43 public Cookie
get(String name) {
49 return c !=
null ? c.getValue() :
null;
52 public void set(String name, String value, String path,
int age) {
56 public void encrypt(String name, String value, String path,
int age) {
60 }
catch (Exception ex) {
69 }
catch (Exception ex) {
75 public void delete(String name, String path) {
static String logMsg(String msg)
static byte[] encrypt(byte[] value)
static byte[] decrypt(byte[] value)
static Cookie getCookie(HttpServletRequest request, String name)
static void setCookie(HttpServletResponse response, String name, String value, String path, int age)
static byte[] decryptCookieValue(Cookie cookie)
static void encryptCookie(HttpServletResponse response, String name, byte[] value, String path, int age)
static void deleteCookie(HttpServletResponse response, String name, String path)
Cookies(HttpServletRequest request, HttpServletResponse response)
String decrypt(String name)
String getValue(String name)
void encrypt(String name, String value, String path, int age)