Fix API: Cookie should be send only when it exists.