com.atlassian.bamboo.build
Class CookieCutterImpl

java.lang.Object
  extended by com.atlassian.bamboo.build.CookieCutterImpl
All Implemented Interfaces:
CookieCutter
Direct Known Subclasses:
FilterController

public class CookieCutterImpl
extends java.lang.Object
implements CookieCutter


Field Summary
static java.lang.String AJS_CONGLOMERATE_COOKIE
           
static int FILTER_COOKIE_AGE
           
 
Constructor Summary
CookieCutterImpl()
           
 
Method Summary
static boolean fixCookies()
          It seems that AJS conglomerate cookie can sometimes start with a quote character without being appropriately terminated with another quote character.
 java.lang.String getValueFromConglomerateCookie(java.lang.String cookieKey, java.lang.String key)
          Retrieve variable from AJS conglomerate cookie.
 java.lang.String getValueFromCookie(java.lang.String key)
           
 java.lang.String getValueFromCookie(java.lang.String key, java.lang.String defaultValue)
           
 void saveValueInCookie(java.lang.String key, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILTER_COOKIE_AGE

public static int FILTER_COOKIE_AGE

AJS_CONGLOMERATE_COOKIE

public static final java.lang.String AJS_CONGLOMERATE_COOKIE
See Also:
Constant Field Values
Constructor Detail

CookieCutterImpl

public CookieCutterImpl()
Method Detail

saveValueInCookie

public void saveValueInCookie(java.lang.String key,
                              java.lang.String value)
Specified by:
saveValueInCookie in interface CookieCutter

getValueFromCookie

@NotNull
public java.lang.String getValueFromCookie(java.lang.String key)
Specified by:
getValueFromCookie in interface CookieCutter

getValueFromCookie

public java.lang.String getValueFromCookie(java.lang.String key,
                                           java.lang.String defaultValue)
Specified by:
getValueFromCookie in interface CookieCutter

fixCookies

public static boolean fixCookies()
It seems that AJS conglomerate cookie can sometimes start with a quote character without being appropriately terminated with another quote character. This causes random cookies to disappear (at least in Jetty, all cookies after and including AJS.conglomerate will be dropped). This may include JSESSIONID, preventing a user from logging in by reissuing a new JSESSIONID with each request. The workaround is to detect that cookie and remove it.

Returns:

getValueFromConglomerateCookie

public java.lang.String getValueFromConglomerateCookie(java.lang.String cookieKey,
                                                       java.lang.String key)
Retrieve variable from AJS conglomerate cookie. AJS saves its cookie variables in single cookie as key=value, '|' char is the separator.

Specified by:
getValueFromConglomerateCookie in interface CookieCutter
Parameters:
cookieKey - key of the cookie
key - key of a variable
Returns:
value or null if not found


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.