Magento 2 add to cart not working localhost Only in chrome

Change base url http://localhost/ to http://127.0.0.1

please follow below step:

Go to database  and find “core_config_data” table

Then change secure and unsecure base url