public Cookie getCookie ( String cookieName ) { List cookies = getHeaders ( SET_COOKIE ) ; if ( cookies != null ) { // start looking from the back (ie. the last cookie set) for ( int i = cookies . size ( ) ; -- i > - 1 ; ) { Cookie cookie = ( Cookie ) cookies . get ( i ) ; if ( cookie . getName ( ) . equals ( cookieName ) ) { return cookie ; } } } return null ; }
Gets a cookie that was added to the response .