cookie based error handling