2 added 199 characters in body
source | link

while installing magento2 on your localhost try to use 127.0.0.1 in the your store address in step 3 instead of the localhost. now what can you do is in core_config_data table change following 2 rows

web/unsecure/base_url to http://127.0.0.1/magento2/
web/secure/base_url to https://127.0.0.1/magento2/

clear cache and check now

Edited:-

While installing try 127.0.0.1 in the your store address in step 3 as shown in the screenshot

enter image description here

while installing magento2 on your localhost try to use 127.0.0.1 instead of the localhost. now what can you do is in core_config_data table change following 2 rows

web/unsecure/base_url to http://127.0.0.1/magento2/
web/secure/base_url to https://127.0.0.1/magento2/

clear cache and check now

while installing magento2 on your localhost try to use 127.0.0.1 in the your store address in step 3 instead of the localhost. now what can you do is in core_config_data table change following 2 rows

web/unsecure/base_url to http://127.0.0.1/magento2/
web/secure/base_url to https://127.0.0.1/magento2/

clear cache and check now

Edited:-

While installing try 127.0.0.1 in the your store address in step 3 as shown in the screenshot

enter image description here

1
source | link

while installing magento2 on your localhost try to use 127.0.0.1 instead of the localhost. now what can you do is in core_config_data table change following 2 rows

web/unsecure/base_url to http://127.0.0.1/magento2/
web/secure/base_url to https://127.0.0.1/magento2/

clear cache and check now