com.atlassian.security.cookie
Class HttpOnlyCookies

java.lang.Object
  extended by com.atlassian.security.cookie.HttpOnlyCookies

public final class HttpOnlyCookies
extends java.lang.Object

Constructs HttpOnly Cookies and adds them to HttpServletResponses. The cookie encoding logic in ServerCookie is derived from Tomcat 6.0.29.

Since:
2.0

Method Summary
static void addHttpOnlyCookie(javax.servlet.http.HttpServletResponse response, javax.servlet.http.Cookie cookie)
          Adds the specified Cookie to the specified HttpServletResponse with the HttpOnly flag.
static void addHttpOnlyCookies(javax.servlet.http.HttpServletResponse response, javax.servlet.http.Cookie[] cookies)
          Adds the specified Cookies to the specified HttpServletResponse with the HttpOnly flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addHttpOnlyCookies

public static void addHttpOnlyCookies(javax.servlet.http.HttpServletResponse response,
                                      javax.servlet.http.Cookie[] cookies)
Adds the specified Cookies to the specified HttpServletResponse with the HttpOnly flag. Cookies marked as HTTP-only will not be available to JavaScript code executing in browsers that support the flag; only the browser itself can access them.

Parameters:
response - the response to add to
cookies - the cookies to add

addHttpOnlyCookie

public static void addHttpOnlyCookie(javax.servlet.http.HttpServletResponse response,
                                     javax.servlet.http.Cookie cookie)
Adds the specified Cookie to the specified HttpServletResponse with the HttpOnly flag. Cookies marked as HTTP-only will not be available to JavaScript code executing in browsers that support the flag; only the browser itself can access them.

Parameters:
response - the response to add to
cookie - the cookie to add


Copyright © 2010 Atlassian. All Rights Reserved.