Page 1 of 1
after login - redirected to front page
Posted: Tue 24. May 2022, 10:54
by hekla
Hi there
I have a strange phenomenon, which I cannot solve:
After an update from v 145 to 193 and moving the installation from dev.domain.tld to
www.domain.tld I cannot login in anymore.
When I log with correct credentials in I am redirected to the front page (with wrong credentials I get a correct error "Fehler beim Anmelden!")
I disabled rewrite rules and the whole htaccess file …
Any ideas?
Re: after login - redirected to front page
Posted: Tue 24. May 2022, 15:58
by top
Try deleting all cookies from the website.
Re: after login - redirected to front page
Posted: Wed 25. May 2022, 12:03
by hekla
It didn't help …
Re: after login - redirected to front page
Posted: Thu 26. May 2022, 14:46
by Oliver Georgi
Check that you use the correct and same domain to login as in the config, maybe something forces to https or www… which will break the session and log you off immediately after login. Also check the new session cookie related config values.
https://github.com/slackero/phpwcms/blo ... #L157-L158
Re: after login - redirected to front page
Posted: Tue 21. Jun 2022, 11:34
by hekla
Thank you for the support.
It still doesn't work – it was not that urgend since it is a quite site. Still …
I now have in the settings:
Code: Select all
$phpwcms['session.cookie_httponly.off'] = false;
$phpwcms['session.cookie_samesite'] = 'Lax';
and:
Code: Select all
$phpwcms['site'] = 'http://www.mydomain.tld";
(with the correct domain, of course and: yes, it is still without SSL)
correct? Or is there anything else I need to do there.
There are no redirections in the htaccess or in the webspace administration.
Then I noted that no cookie at all is set, when I try to log in.
Cloud this be part of the problem?
Re: after login - redirected to front page
Posted: Tue 21. Jun 2022, 12:31
by Oliver Georgi
It's hard to tell because I do not know your environment. Which PHP version? Choose 7.4+
Try
Code: Select all
$phpwcms['session.cookie_httponly.off'] = true;
$phpwcms['session.cookie_samesite'] = 'None';
Check your PHP error log.
Re: after login - redirected to front page
Posted: Tue 21. Jun 2022, 12:42
by hekla
Thank you Oliver.
It's php 7.4.28
Can I send you a link to phpinfo via PN?
Re: after login - redirected to front page
Posted: Tue 21. Jun 2022, 13:17
by Oliver Georgi
hekla wrote: Tue 21. Jun 2022, 12:42Can I send you a link to phpinfo via PN?
by email please
Re: after login - redirected to front page
Posted: Thu 23. Jun 2022, 18:03
by hekla
thank you, Oliver.
I am really lost.
At the site I updated I am just redirectet to the front page when trying to log in.
Then I tried all kind of things, several times, but I cannot find out, why it doesn't work.
I cannot login ("Fehler beim Anmelden!") - the pwd is definitely correct.
I copied an other phpwcms site and DB (with working login) to the webspace
I tried it with a clean install
I tried a clean install on an other webpace
I tried to login from an other computer
I used VPN (in case of a network firewall etc).
No luck.
Everything with version 1.9.33
Any ideas?
Re: after login - redirected to front page
Posted: Thu 23. Jun 2022, 21:32
by Oliver Georgi
you have my contact, send me login credentials and I can check.
Re: after login - redirected to front page
Posted: Fri 24. Jun 2022, 10:07
by Oliver Georgi
In this case: check that there is also no problem with the database after update/upgrade or installation of phpwcms.
To enable database logging, set the following line in your
/include/config/conf.inc.php
:
Code: Select all
$phpwcms['db_errorlog'] = true; // Log DB queries - false|true
Do some operations on your side, i.e. login. If this fails or some other things should not work as expected, check the entries in the file
/content/log/phpwcms_db_error.log
.
The above reported problem had a missing
AUTO_INCREMENT
so the required entry after login couldn't be written into the database – and the login always failed…
Re: after login - redirected to front page
Posted: Fri 24. Jun 2022, 11:13
by hekla
Thank you, Oliver, for your excellent support!
Re: after login - redirected to front page
Posted: Sun 26. Jun 2022, 00:05
by hekla
Oliver Georgi wrote: Fri 24. Jun 2022, 10:07
The above reported problem had a missing
AUTO_INCREMENT
so the required entry after login couldn't be written into the database – and the login always failed…
Since it worked before and I just moved form the subdomain to the main domain by assigning the domain to the new directory witouth changing anything in the database or the phpwcms installation – how can this happen? Is there an explanation for that?
Re: after login - redirected to front page
Posted: Sun 26. Jun 2022, 09:33
by Oliver Georgi
hekla wrote: Sun 26. Jun 2022, 00:05
Since it worked before and I just moved form the subdomain to the main domain by assigning the domain to the new directory without changing anything in the database or the phpwcms installation – how can this happen? Is there an explanation for that?
Hard to say, I have no clue. Maybe check an older database dump if
AUTO_INCREMENT
was missing before the update. No internal update touches this and especially not this table.