I have Migrated Magento 2 website from subdomain to root. after migration user cant logged into the account but admin is working fine. if user clear the cache and try to login , login works fine but when the cookies expire it wont work. Everything look perfect but dont know what can be the issue.
I got the solution for it, i installed the php chat plugin on the server and embed into magento 2 website. the issue was coming from the cookies that both of them was generated on the same url. when you look at the PHPSSID into the inspect element , it will show duplicate PHPSSID and one of them was conflicted with origenal one. Solution - i have created the subdomian and copy the chat code into the subdomain. that completely solve my problem.
It must be your cookie domain issue.
Check at core_config_data database table
run the sql query
select * from core_config_data where path like '%cookie%';
to check the setting.
Cookie domain value should be domain.