Error after login if using http

Hi All,

This may be a hosting issue, but hoping someone can help shed some light on what is going on. Firstly I recently installed and SSL cert on my hosting and redirect all http access to https via the following code in a .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NC]

If I visit my website via https://myurl.ie and login via my login page all redirects work correctly. If I visit my url via myurl.ie. The .htaccess file works correctly and redirects to the secure site. However when I go to login via this method, my webpage that should appear after login does not appear and the following code is shown in the browser:

{“code”:0,“file”:"/var/www/vhosts/201/1072037/webspace/httpdocs/strongbo.ie/dmxConnectLib/lib/db/SqlBuilder.php",“line”:26,“message”:“Argument 2 passed to lib\db\SqlBuilder::__construct() must be an instance of lib\db\Connection, null given, called in /var/www/vhosts/201/1072037/webspace/httpdocs/strongbo.ie/dmxConnectLib/lib/auth/DatabaseProvider.php on line 23”,“trace”:"#0 /var/www/vhosts/201/1072037/webspace/httpdocs/strongbo.ie/dmxConnectLib/lib/auth/DatabaseProvider.php(23): lib\db\SqlBuilder->__construct(Object(lib\App), NULL)\n#1 /var/www/vhosts/201/1072037/webspace/httpdocs/strongbo.ie/dmxConnectLib/lib/auth/Provider.php(113): lib\auth\DatabaseProvider->validate(‘Demonstrator’, ‘ff2adf23dcee05a…’)\n#2 /var/www/vhosts/201/1072037/webspace/httpdocs/strongbo.ie/dmxConnectLib/lib/auth/Provider.php(65): lib\auth\Provider->login(‘Demonstrator’, 'XXX, true, true)\n#3 /var/www/vhosts/201/1072037/webspace/httpdocs/strongbo.ie/dmxConnectLib/modules/auth.php(11): lib\auth\Provider->__construct(Object(lib\App), Object(stdClass), ‘sec’)\n#4 /var/www/vhosts/201/1072037/webspace/httpdocs/strongbo.ie/dmxConnectLib/lib/App.php(159): modules\auth->provider(Object(stdClass), ‘sec’)\n#5 /var/www/vhosts/201/1072037/webspace/httpdocs/strongbo.ie/dmxConnectLib/lib/App.php(128): lib\App->execSteps(Object(stdClass))\n#6 /var/www/vhosts/201/1072037/webspace/httpdocs/strongbo.ie/dmxConnectLib/lib/App.php(98): lib\App->execSteps(Array)\n#7 /var/www/vhosts/201/1072037/webspace/httpdocs/strongbo.ie/dashboard.php(19): lib\App->exec(Object(stdClass), true)\n#8 {main}"}

Does anyone know why this might be happening? Like I said, if I visit my webpage by directly typing in https://myurl.ie then this issue does not exist. Thanks in advance.

Actually, I have been testing this using an incognito tab, could this be the reason for this?
It seems to happen if I visit from a device that I have not successfully loaded the page before.

Well yes of course- in incognito mode no cookies are store, so no login can be done

Thanks for the quick reply George. This still occasionally occurs when someone new log’s in, even outside of incognito mode. What is happening when this code appears?

I just tested on a mobile and I got this output, not in incognito mode, then I tried a minute later and it worked fine.

Do note that http and https are complete separate environments, so you can’t login from one and stay logged in to the other

Not sure about the error though, when exactly are you getting it and is it every time?

Maybe @patrick should investigate

That exact code that I posted above is returned on the page, I did replace the first half of the login password with XXX though. Each time I visit I enter the login details, so I’m not worried about remaining logged in.

I’ll try get my hands on some more devices that have not previously logged in to troubleshoot some more and will get back to you.

If you can’t resolve, maybe you can use this…I redirect using this directive and don’t have any trouble with login:

RedirectMatch ^/(?!.well-known)(.*)$ https://YOUR-DOMAIN/$1

Ours has an exception for the folder needed for our ssl cert renewal (.well-known).

Thanks for the reply, I will give this a try and will post back after some testing.