public static < T extends Model > void saveMemberInCookie ( T user , boolean save , HttpServletRequest request , HttpServletResponse response ) { String new_value = getLoginKey ( user , Requests . remoteIP ( request ) , request . getHeader ( "user-agent" ) ) ; int max_age = save ? MAX_AGE : - 1 ; Requests . deleteCookie ( request , response , COOKIE_LOGIN , true ) ; Requests . setCookie ( request , response , COOKIE_LOGIN , new_value , max_age , true ) ; }
Store user information in a cookie logged in .