2

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.

3
  • Did you check the logs of magento 2?
    – klict
    Commented May 8, 2018 at 11:37
  • Kindly check magento log files when user are not able to login. Commented May 8, 2018 at 11:46
  • it doest not produce any error in log
    – Atif Aqeel
    Commented May 8, 2018 at 17:00

5 Answers 5

1

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.

1
  • Can you explin More ? I didn't find chat plugin for php server Commented Nov 11, 2021 at 6:01
0

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.

1
  • i tried both with input the url and null value. still same
    – Atif Aqeel
    Commented May 8, 2018 at 17:00
0

After the Magento upgrade, if your Magento project faces an error on the user login page, just go to the back-end of Magento(admin)>customers>all customers>(your user). Select the user and make changes from pending to approved Go on..

0

check var/session/ folder and if the session is not there then check app/etc/env.php for session storage.

0

It's very late but might be helpful for someone else. I have created this workaround to avoid cookies conflict in subdomain:

Override these 2 settings in your php.ini file:

session.cookie_domain = "subdomain.site.com"
session.name = "subdomain_PHPSESSID"

Changes the PHP session cookie name from PHPSESSID to subdomain_PHPSESSID and also sets the cookie_domain to subdomain.site.com. After this, customer login will work fine even without clearing the browser cookies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.