private static CookieUser userForCookie ( String uuid , HttpServletRequest request ) { if ( StringUtils . isBlank ( uuid ) ) { return null ; } String ck = decrypt ( uuid ) ; final String [ ] items = StringUtils . split ( ck , ' ' ) ; if ( items . length == 5 ) { String ua = request . getHeader ( "user-agent" ) ; int ua_code = ( ua == null ) ? 0 : ua . hashCode ( ) ; int old_ua_code = Integer . parseInt ( items [ 3 ] ) ; if ( ua_code == old_ua_code ) { return new CookieUser ( NumberUtils . toLong ( items [ 0 ] , - 1L ) , items [ 1 ] , false ) ; } } return null ; }
Obtain user information from the Cookie