cookie listener and view helper