If a website uses non-standard port (i.e. http://example.com:12345/4images) redirects (i.e. after login or logout) won't work on some browsers (Internet Explorer, Google Chrome).
The problem is in $_SERVER['HTTP_HOST'] which might contain the port number.
To fix this find in global.php:
$script_url .= (!empty($HTTP_SERVER_VARS['HTTP_HOST'])) ? $HTTP_SERVER_VARS['HTTP_HOST'] : getenv("SERVER_NAME");
Insert BELOW:
if ($port) $script_url = str_replace($port, "", $script_url);