@ Override public Result clearTokenIfInvalid ( Context context , String msg ) { Result error = handler . onError ( context , msg ) ; final String cookieName = getCookieName ( ) ; if ( cookieName != null ) { Cookie cookie = context . cookie ( cookieName ) ; if ( cookie != null ) { return error . without ( cookieName ) ; } } else { context . session ( ) . remove ( getTokenName ( ) ) ; } return error ; }
Clears the token from the request