use state machine to analyze cookie