Page 1 of 2

can not login from chrome browser

Posted: Sat Aug 04, 2018 16:20 UTC
by xazip
Hello everyone
I have installed blacknova 0.63 on my server
http://93.188.161.89/bnt/
but I am able to log in via firefox only and not via chrome
when i try to login using chrome browser on main.php file i am getting stucked at
"you need to log in" screen
how can i solve this ?

Re: can not login from chrome browser

Posted: Sat Aug 04, 2018 16:43 UTC
by TheMightyDude
Tell Chrome to allow cookies.

BNT requires cookies to work.

Re: can not login from chrome browser

Posted: Sun Aug 05, 2018 10:44 UTC
by xazip
I have already enabled cookies but still it dont work on chrome with my installation
same game on other sites are working fine.
it has also stored some cookies in my chrome
but still stuck on login screen

Re: can not login from chrome browser

Posted: Sun Aug 05, 2018 11:24 UTC
by xazip
I have edited my db_config file and updated with this value
$gamedomain = "93.188.161.89";
$gamepath = "/bnt/;
but still it dont work
I dont have domain at the moment but will it require ?

Re: can not login from chrome browser

Posted: Sun Aug 05, 2018 11:26 UTC
by TheMightyDude
xazip wrote:I have already enabled cookies but still it dont work on chrome with my installation
same game on other sites are working fine.
it has also stored some cookies in my chrome
but still stuck on login screen
Hmm, should work ok, I assume the server is running on Linux it seems that you are.
Have you tried to remove the . (dot) before the IP in the config for the domain.

It does work when using an IP due to my Test Server uses IP only.

Also in global_includes.php look for:
include_once $ADOdbpath . "/session/adodb-session.php";
and change it to:
include_once $ADOdbpath . "/session/adodb-session2.php";

Re: can not login from chrome browser

Posted: Sun Aug 05, 2018 11:32 UTC
by TheMightyDude
Let me setup another test one.

OK, I am seeing the exact same issue as you now on the test version, I will look into it now and get back once I have a fix.

Re: can not login from chrome browser

Posted: Sun Aug 05, 2018 11:33 UTC
by xazip
just changed that to what you said now setup_info.php file is not opening in browser

Re: can not login from chrome browser

Posted: Sun Aug 05, 2018 11:55 UTC
by xazip
here is my server URL
http://93.188.161.89/bnt/setup_info.php
which is not passing cookie tests

Re: can not login from chrome browser

Posted: Sun Aug 05, 2018 12:58 UTC
by TheMightyDude
Ok, I think I have a fix...

in global_cleanup.php look for the following line:

if (isset($gamedomain) && strlen($gamedomain) >0)

and change it to the following:

if (ip2long($_SERVER['HTTP_HOST']) === false && (isset($gamedomain) && strlen($gamedomain) >0))

In setup_info_class.php look for function get_gamedomain should be on line 169.


Add the following after lines: $result = $_SERVER['HTTP_HOST'];

Code: Select all

if (ip2long($_SERVER['HTTP_HOST']) !== false)
{
    $game_domain['result'] = $result;
    $game_domain['status'] = true;
    return $game_domain;
}
So that function should look like the following:

Code: Select all

    function get_gamedomain($compare = false)
    {
        $game_domain['result']  = null;
        $game_domain['info']    = null;
        $game_domain['status']  = false;

        $RemovePORT = true;
        $result = $_SERVER['HTTP_HOST'];

        if (ip2long($_SERVER['HTTP_HOST']) !== false)
        {
            $game_domain['result'] = $result;
            $game_domain['status'] = true;
            return $game_domain;
        }

        if (isset($result) && strlen($result) >0)
        {
            $pos = strpos($result,"http://");
            if (is_integer($pos))
            {
                $result = substr($result,$pos+7);
            }
            $pos = strpos($result,"www.");
            if (is_integer($pos))
            {
                $result = substr($result,$pos+4);
            }
            if ($RemovePORT)
            {
                $pos = strpos($result,":");
            }
            if (is_integer($pos))
            {
                $result = substr($result,0,$pos);
            }
            if ($result[0]!=".")
            {
                $result=".$result";
            }
            $game_domain['result'] = $result;
            $game_domain['status'] = true;
        }
        else
        {
            $game_domain['info']   = (($compare) ?"Unable to detect the gamedomain to compare!":"Unable to detect the gamedomain!");
            $game_domain['status'] = false;
        }

        return $game_domain;
    }
Basically what these changes do is check if you are using an IP and if so skip the code that is for a domain, that's what was causing the issue with chrome.

I have always used a domain name so I never saw and issue, and for my dev server I always used IE or Edge.

Let me know if that works after those changes?

Re: can not login from chrome browser

Posted: Sun Aug 05, 2018 13:18 UTC
by xazip
Thanks a lot that issue is solved and game is running on my server.
what about localhost ?
i am facing same issue with localhost it don't work on chrome but works on firefox
any solution for that ?