after login - redirected to front page

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
hekla
Posts: 99
Joined: Tue 31. Jan 2006, 08:37

after login - redirected to front page

Post 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?
User avatar
top
Posts: 535
Joined: Fri 11. Aug 2006, 15:03
Location: Eutin

Re: after login - redirected to front page

Post by top »

Try deleting all cookies from the website.
hekla
Posts: 99
Joined: Tue 31. Jan 2006, 08:37

Re: after login - redirected to front page

Post by hekla »

It didn't help …
User avatar
Oliver Georgi
Site Admin
Posts: 9901
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: after login - redirected to front page

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
hekla
Posts: 99
Joined: Tue 31. Jan 2006, 08:37

Re: after login - redirected to front page

Post 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?
User avatar
Oliver Georgi
Site Admin
Posts: 9901
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: after login - redirected to front page

Post 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.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
hekla
Posts: 99
Joined: Tue 31. Jan 2006, 08:37

Re: after login - redirected to front page

Post by hekla »

Thank you Oliver.

It's php 7.4.28

Can I send you a link to phpinfo via PN?
User avatar
Oliver Georgi
Site Admin
Posts: 9901
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: after login - redirected to front page

Post by Oliver Georgi »

hekla wrote: Tue 21. Jun 2022, 12:42Can I send you a link to phpinfo via PN?
by email please
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
hekla
Posts: 99
Joined: Tue 31. Jan 2006, 08:37

Re: after login - redirected to front page

Post 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?
User avatar
Oliver Georgi
Site Admin
Posts: 9901
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: after login - redirected to front page

Post by Oliver Georgi »

you have my contact, send me login credentials and I can check.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Oliver Georgi
Site Admin
Posts: 9901
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: after login - redirected to front page

Post 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…
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
hekla
Posts: 99
Joined: Tue 31. Jan 2006, 08:37

Re: after login - redirected to front page

Post by hekla »

Thank you, Oliver, for your excellent support!
hekla
Posts: 99
Joined: Tue 31. Jan 2006, 08:37

Re: after login - redirected to front page

Post 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?
User avatar
Oliver Georgi
Site Admin
Posts: 9901
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: after login - redirected to front page

Post 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.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply