can not login from chrome browser

Trying to install BNT? No guarantees we can help you (especially if you're hosting it on windows) but we''ll try.

User avatar

Posts: 6

Joined: Sat Aug 04, 2018 5:14 pm

Post Sat Aug 04, 2018 5:20 pm

can not login from chrome browser

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 ?
User avatar

Site Admin

Posts: 241

Joined: Thu Apr 17, 2014 10:15 am

Post Sat Aug 04, 2018 5:43 pm

Re: can not login from chrome browser

Tell Chrome to allow cookies.

BNT requires cookies to work.
TheMightyDude::Blacknova Development.
Development Blog Twitter
User avatar

Posts: 6

Joined: Sat Aug 04, 2018 5:14 pm

Post Sun Aug 05, 2018 11:44 am

Re: can not login from chrome browser

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
User avatar

Posts: 6

Joined: Sat Aug 04, 2018 5:14 pm

Post Sun Aug 05, 2018 12:24 pm

Re: can not login from chrome browser

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 ?
Last edited by xazip on Sun Aug 05, 2018 12:27 pm, edited 1 time in total.
User avatar

Site Admin

Posts: 241

Joined: Thu Apr 17, 2014 10:15 am

Post Sun Aug 05, 2018 12:26 pm

Re: can not login from chrome browser

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";
TheMightyDude::Blacknova Development.
Development Blog Twitter
User avatar

Site Admin

Posts: 241

Joined: Thu Apr 17, 2014 10:15 am

Post Sun Aug 05, 2018 12:32 pm

Re: can not login from chrome browser

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.
TheMightyDude::Blacknova Development.
Development Blog Twitter
User avatar

Posts: 6

Joined: Sat Aug 04, 2018 5:14 pm

Post Sun Aug 05, 2018 12:33 pm

Re: can not login from chrome browser

just changed that to what you said now setup_info.php file is not opening in browser
User avatar

Posts: 6

Joined: Sat Aug 04, 2018 5:14 pm

Post Sun Aug 05, 2018 12:55 pm

Re: can not login from chrome browser

here is my server URL
http://93.188.161.89/bnt/setup_info.php
which is not passing cookie tests
User avatar

Site Admin

Posts: 241

Joined: Thu Apr 17, 2014 10:15 am

Post Sun Aug 05, 2018 1:58 pm

Re: can not login from chrome browser

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:
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:
    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?
TheMightyDude::Blacknova Development.
Development Blog Twitter
User avatar

Posts: 6

Joined: Sat Aug 04, 2018 5:14 pm

Post Sun Aug 05, 2018 2:18 pm

Re: can not login from chrome browser

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 ?
Next

Return to Installation Help



Who is online

Users browsing this forum: No registered users and 2 guests

cron