Spent a couple of days for struggled in login session. When run the pH7cms which is SNS open source which made of PHP on the VirtualBox it happened.

Environment:

  • macOS High Sierra
  • VirtualBox 5.2.6
  • CentOS 7.4.1708
  • PHP 7.0.27
  • NGINX 1.12.2
  • MySQL 5.6.39
  • pH7cms

Always failed to login by admin, except Firefox. Safari and Chrome was couldn’t. Checked the codes, and the browser debugger. I finally found that cause. In case of using IP address (ex. 192.168.56.101) not domain name for setcookie’s domain. seems Safari and Chrome can’t accept Cookie correctly.

Server side engineer seems well known issue but for your information.

To resolve this issue, modified hosts both CentOS and macOS, like:

I hope this will help.