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.
xazip
Posts: 6
Joined: Sat Aug 04, 2018 5:14 pm

can not login from chrome browser

Post by xazip » Sat Aug 04, 2018 5:20 pm

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
TheMightyDude
Site Admin
Posts: 241
Joined: Thu Apr 17, 2014 10:15 am

Re: can not login from chrome browser

Post by TheMightyDude » Sat Aug 04, 2018 5:43 pm

Tell Chrome to allow cookies.

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

xazip
Posts: 6
Joined: Sat Aug 04, 2018 5:14 pm

Re: can not login from chrome browser

Post by xazip » Sun Aug 05, 2018 11:44 am

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

xazip
Posts: 6
Joined: Sat Aug 04, 2018 5:14 pm

Re: can not login from chrome browser

Post by xazip » Sun Aug 05, 2018 12:24 pm

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
TheMightyDude
Site Admin
Posts: 241
Joined: Thu Apr 17, 2014 10:15 am

Re: can not login from chrome browser

Post by TheMightyDude » Sun Aug 05, 2018 12:26 pm

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 Twitch

User avatar
TheMightyDude
Site Admin
Posts: 241
Joined: Thu Apr 17, 2014 10:15 am

Re: can not login from chrome browser

Post by TheMightyDude » Sun Aug 05, 2018 12:32 pm

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 Twitch

xazip
Posts: 6
Joined: Sat Aug 04, 2018 5:14 pm

Re: can not login from chrome browser

Post by xazip » Sun Aug 05, 2018 12:33 pm

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

xazip
Posts: 6
Joined: Sat Aug 04, 2018 5:14 pm

Re: can not login from chrome browser

Post by xazip » Sun Aug 05, 2018 12:55 pm

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

User avatar
TheMightyDude
Site Admin
Posts: 241
Joined: Thu Apr 17, 2014 10:15 am

Re: can not login from chrome browser

Post by TheMightyDude » Sun Aug 05, 2018 1:58 pm

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

xazip
Posts: 6
Joined: Sat Aug 04, 2018 5:14 pm

Re: can not login from chrome browser

Post by xazip » Sun Aug 05, 2018 2:18 pm

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 ?

Post Reply