public static Cookie cookie ( String name ) { javax . servlet . http . Cookie [ ] servletCookies = RequestContext . getHttpRequest ( ) . getCookies ( ) ; if ( servletCookies != null ) { for ( javax . servlet . http . Cookie servletCookie : servletCookies ) { if ( servletCookie . getName ( ) . equals ( name ) ) { return Cookie . fromServletCookie ( servletCookie ) ; } } } return null ; }
Returns a cookie by name null if not found .