public static String extractCookie ( final HttpServletRequest request , final String name ) { for ( Cookie cookie : request . getCookies ( ) ) { if ( cookie . getName ( ) . equals ( name ) ) { return cookie . getValue ( ) ; } } return null ; }
Find the value of a cookie on the request by name .