The same PHP script I'm using works fine with sessions on a domain website like example.com but not so when it's uploaded and accessed on a bare IP address website with an arbitrary HTTP port number like this:
Variables can be set in $_SESSION which is accessible in the same PHP request but they are gone with the next page load.
session_set_cookie_params( 0, '/', '111.222.333.444:5566' ); session_start();
But it's not working. Also checked phpinfo() and the bare IP site's session is enabled. My browser does support cookie when both of the tests are run.
This is weird. What could be wrong here? Is PHP session meant to not persist on bare IP site with exotic HTTP port?