Added eventhandler to pipeline, refactored cookie reading