com.samskivert.servlet.util
Class CookieUtil

java.lang.Object
  extended by com.samskivert.servlet.util.CookieUtil

public class CookieUtil
extends Object

Utility methods for dealing with cookies.


Constructor Summary
CookieUtil()
           
 
Method Summary
static void clearCookie(javax.servlet.http.HttpServletResponse rsp, String name)
          Clear the cookie with the specified name.
static javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest req, String name)
          Get the cookie of the specified name, or null if not found.
static String getCookieValue(javax.servlet.http.HttpServletRequest req, String name)
          Get the value of the cookie for the cookie of the specified name, or null if not found.
static void widenDomain(javax.servlet.http.HttpServletRequest req, javax.servlet.http.Cookie cookie)
          Sets the domain of the specified cookie to the server name associated with the supplied request minus the hostname (ie.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieUtil

public CookieUtil()
Method Detail

getCookie

public static javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest req,
                                                  String name)
Get the cookie of the specified name, or null if not found.


getCookieValue

public static String getCookieValue(javax.servlet.http.HttpServletRequest req,
                                    String name)
Get the value of the cookie for the cookie of the specified name, or null if not found.


clearCookie

public static void clearCookie(javax.servlet.http.HttpServletResponse rsp,
                               String name)
Clear the cookie with the specified name.


widenDomain

public static void widenDomain(javax.servlet.http.HttpServletRequest req,
                               javax.servlet.http.Cookie cookie)
Sets the domain of the specified cookie to the server name associated with the supplied request minus the hostname (ie. www.samskivert.com becomes .samskivert.com).



Copyright © 2000-2008 Michael Bayne. All Rights Reserved.