public static void addCookiesToResponse ( List < Cookie > cookieList , HttpServletResponse resp ) { Iterator < Cookie > iterator = cookieList . listIterator ( ) ; while ( iterator . hasNext ( ) ) { Cookie cookie = iterator . next ( ) ; if ( cookie != null ) { resp . addCookie ( cookie ) ; } } }
Given a list of Cookie objects set them into the HttpServletResponse . This method does not alter the cookies in any way .