Update bean event handler to write cookies