TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 07:23:29 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,106
  • Total Topics: 21,213
  • Online today: 358
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online

SMF 2.1 redirect 404 error on login with TP

Started by @rjen, March 12, 2022, 10:03:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

@rjen

Guys, question

I upgraded my forum to 2.1 today. TinyPortal on it, now I am getting a 404 error everytime after loggin in. After that all works fine, but when logging out and logging in same error again.

I see nothing in the logs.
When I uninstall TP the issue is gone. Reinstalled and it is back.

It seems to me that the redirect from logging in is somehow wrong. I tried both options: forum or Frontpage, but makes no difference

Forum is on https ....

Any ideas where to look ?
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Log in via standard link or the one in the user block?

@rjen

Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

What version of PHP?

Can't replicate this atm. Logs in ok via the login box at the top of the screen.

Any errors shown anywhere when getting the 404? Does the login url look correct in the inspector?

@rjen

No errors, PHP 7.4. Need to check tomorrow, going to sleep now...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

@rjen

Would you mind trying it here for yourself?

https://test.fjr-club.nl/

User: "test forumlid"
Password: testtest

Then you can see what I see...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

lurkalot

I'm not seeing any error using that test account.  Logged in and out a couple of times without issue.

Maybe a browser issue, have you tried a different one just in case. I'm using Edge.

@rjen

You are not getting this screen after login? It's a custom 404 , and I am getting it in all browsers as well on my pc as on mobile...

Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Quote from: @rjen on March 13, 2022, 08:31:02 AM
You are not getting this screen after login? It's a custom 404 , and I am getting it in all browsers as well on my pc as on mobile...

I get the same on my mobile. I'll try it on my desktop later today and try and see where it's breaking.

@rjen

Thanks, it has been driving me nuts! And it seems it is something that does not happen to everyone , so may have some relation to user permissions or settings
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Quote from: @rjen on March 13, 2022, 09:19:53 AM
Thanks, it has been driving me nuts! And it seems it is something that does not happen to everyone , so may have some relation to user permissions or settings

It's something around the SESSION can you add some logging to see the value of this variable

https://github.com/SimpleMachines/SMF2.1/blob/acee5b182b8f692c99fb4c6af08eb1d0258a4cfe/Sources/LogInOut.php#L208

I think that isn't correctly set sometimes, although what it is set to I can't see without access to the SESSION.

You can log to the database so that it isn't visible to uses doing this

log_error(var_export($_SESSION, true), 'general', __FILE__, __LINE__);

tino

A bit more information.

If I clear out the cache for saved cookies then I can login without issues. If I login then logout then login again I get a 404.

@rjen

Quote from: tino on March 13, 2022, 10:18:10 AM
Quote from: @rjen on March 13, 2022, 09:19:53 AM
Thanks, it has been driving me nuts! And it seems it is something that does not happen to everyone , so may have some relation to user permissions or settings

It's something around the SESSION can you add some logging to see the value of this variable

https://github.com/SimpleMachines/SMF2.1/blob/acee5b182b8f692c99fb4c6af08eb1d0258a4cfe/Sources/LogInOut.php#L208

I think that isn't correctly set sometimes, although what it is set to I can't see without access to the SESSION.

You can log to the database so that it isn't visible to uses doing this

log_error(var_export($_SESSION, true), 'general', __FILE__, __LINE__);

Never done this before. Where do you want me to add the code? And where will it log to?
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino


@rjen

Ok, I got two errors logged.

Error 1:

Guest
2a02:a213:a701:c080:e978:66ac:9e70:3ea9
7bcc369c36a349f51387be22248460a2
https://test.fjr-club.nl/index.php?action=login2;ajax
/home/deb77453/domains/fjr-club.nl/public_html/test/Sources/LogInOut.php (Line 113) 

error message:

array (
'session_value' => '7bcc369c36a349f51387be22248460a2',
'session_var' => 'de5650b093',
'token' =>
array (
'post-login' =>
array (
0 => 'b85b266',
1 => 'b5b654cb385ea09acf919a1cdde7bb31',
2 => 1647202700,
3 => 'f0fe2c52eed3b0e0e53adad7d0c9a7ed',
),
),
'robot_check' => 1647202696,
'mc' =>
array (
'time' => 1647202696,
'id' => 0,
'gq' => '0=1',
'bq' => '0=1',
'ap' =>
array (
),
'mb' =>
array (
),
'mq' => '0=1',
),
'ban' =>
array (
'last_checked' => 1647202696,
'id_member' => 0,
'ip' => '2a02:a213:a701:c080:e978:66ac:9e70:3ea9',
'ip2' => '2a02:a213:a701:c080:e978:66ac:9e70:3ea9',
'email' => '',
),
'log_time' => 1647202696,
'timeOnlineUpdated' => 1647202696,
'old_url' => 'https://test.fjr-club.nl/index.php?action=login;ajax',
'USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36',
'login_url' => 'https://test.fjr-club.nl/index.php?page=404-Pagina-niet-gevonden',
)


Error 2:
@rjen
2a02:a213:a701:c080:e978:66ac:9e70:3ea9
7bcc369c36a349f51387be22248460a2
https://test.fjr-club.nl/index.php?action=login2;sa=check;member=3
/home/deb77453/domains/fjr-club.nl/public_html/test/Sources/LogInOut.php (Line 113)

array (
'session_value' => '7bcc369c36a349f51387be22248460a2',
'session_var' => 'de5650b093',
'token' =>
array (
'post-login' =>
array (
0 => 'da1989b4637',
1 => 'eec50f921f99e4e80f16a7ab2b0e3fe0',
2 => 1647202703,
3 => '8184085d2eb075ec9d3a8c04e7006e0c',
),
),
'robot_check' => 1647202696,
'mc' =>
array (
'time' => 1647202704,
'id' => 3,
'gq' => '1=1',
'bq' => '1=1',
'ap' =>
array (
0 => 0,
),
'mb' =>
array (
),
'mq' => '0=1',
),
'ban' =>
array (
'last_checked' => 1647202696,
'id_member' => 0,
'ip' => '2a02:a213:a701:c080:e978:66ac:9e70:3ea9',
'ip2' => '2a02:a213:a701:c080:e978:66ac:9e70:3ea9',
'email' => '',
),
'log_time' => 1647202704,
'timeOnlineUpdated' => 1647202696,
'old_url' => 'https://test.fjr-club.nl/index.php?action=login2;ajax',
'USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36',
'login_url' => 'https://test.fjr-club.nl/index.php?page=404-Pagina-niet-gevonden',
'login_SMFCookie202110' => '{"0":3,"1":"724456a316016e9aca1b175ad59fa5e468652aed3199de4d756596d14b04bb89baf278266e2f4e3a3b0a2032b9f51da4a085f4f20f5b5acfafb782d1444ec601","2":1649794704,"3":"","4":"\\/"}',
'id_msg_last_visit' => '373871',
'rc' =>
array (
'id' => 3,
'time' => 1647202704,
'reports' => '0',
'member_reports' => '0',
),
)
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

The login_url is set to 404 page, question is why.

@rjen

Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

How do you set that custom 404 page?

My guess is it's something related to that.

The fact it's only on a old session not a fresh one suggests that the url somehow isn't being cleared.

@rjen

I seems that I fixed it now...

the custom 404 was referred to in the .htaccess file:


GeoIPEnable On     
SetEnvIf GEOIP_COUNTRY_CODE CN DenyCountry 
SetEnvIf GEOIP_COUNTRY_CODE_V6 CN DenyCountry
SetEnvIf GEOIP_COUNTRY_CODE A1 DenyCountry 
SetEnvIf GEOIP_COUNTRY_CODE_V6 A1 DenyCountry
order allow,deny
deny from env=DenyCountry
deny from 220.243.
deny from 46.229.168.
allow from all
   
ErrorDocument 404 /index.php?page=404-Pagina-niet-gevonden

RewriteEngine on

# Automatisch doorsturen naar UNDER_CONSTRUCTION behalve bepaalde IP adressen ONDERHOUD
# RewriteCond %{REMOTE_ADDR} !^216.131.88.190$
# RewriteCond %{REQUEST_URI} !=/under_construction.html
# RewriteCond %{REQUEST_FILENAME} !.(gif|jpe?g|png)$
# RewriteRule ^ http://test.fjr-club.nl/under_construction.html [R=307,L]

# Automatisch doorsturen naar SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
....



The line: ErrorDocument 404 /index.php?page=404-Pagina-niet-gevonden

After I removed that it seems that the login error is not happening anymore...

Now for the 64000 $ question: this page reference has been in my .htaccess for ages, and it worked fine...

For the books...
1. What has changed now?
2. And why does it only create problems when TinyPortal is installed...?

We may never know, but still...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

@rjen

Just for the record: when I login now the logged message does not hold a login-URL anymore...

Error 1:

array (
'session_value' => 'e1d9d3aab403473defc8ed11b3887e8b',
'session_var' => 'a97eae7f210',
'token' =>
array (
'post-login' =>
array (
0 => 'c7974be513',
1 => 'efb038d21b62497375e2caa03fb7012f',
2 => 1647251080,
3 => 'b0fe54b6d4e51212bea4e6538e70b27c',
),
),
'robot_check' => 1647251075,
'mc' =>
array (
'time' => 1647251075,
'id' => 0,
'gq' => '0=1',
'bq' => '0=1',
'ap' =>
array (
),
'mb' =>
array (
),
'mq' => '0=1',
),
'ban' =>
array (
'last_checked' => 1647251075,
'id_member' => 0,
'ip' => '2a02:a213:a701:c080:bdf3:7499:e9f1:b65e',
'ip2' => '2a02:a213:a701:c080:bdf3:7499:e9f1:b65e',
'email' => '',
),
'log_time' => 1647251075,
'timeOnlineUpdated' => 1647251075,
'old_url' => 'https://test.fjr-club.nl/index.php?action=login;ajax',
'USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36',
)


Error 2:

array (
'session_value' => 'e1d9d3aab403473defc8ed11b3887e8b',
'session_var' => 'a97eae7f210',
'token' =>
array (
'post-login' =>
array (
0 => 'b97407bfcf',
1 => '25b29238d058088378a88b58d77b57ca',
2 => 1647251082,
3 => '683c2683c7e522ceda22325e33086ed8',
),
),
'robot_check' => 1647251075,
'mc' =>
array (
'time' => 1647251083,
'id' => 3,
'gq' => '1=1',
'bq' => '1=1',
'ap' =>
array (
0 => 0,
),
'mb' =>
array (
),
'mq' => '0=1',
),
'ban' =>
array (
'last_checked' => 1647251075,
'id_member' => 0,
'ip' => '2a02:a213:a701:c080:bdf3:7499:e9f1:b65e',
'ip2' => '2a02:a213:a701:c080:bdf3:7499:e9f1:b65e',
'email' => '',
),
'log_time' => 1647251083,
'timeOnlineUpdated' => 1647251075,
'old_url' => 'https://test.fjr-club.nl/index.php?action=login2;ajax',
'USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36',
'login_SMFCookie202110' => '{"0":3,"1":"f10e7b93e26becaf50faec1288136cbb9c0c9676e5b5a8f8a46e147f5e53cabdc87472a1a66dc9883c5f46dfb533fa2911ae611f7ce7cd6ebff51567d4dfa634","2":1836467082,"3":"","4":"\\/"}',
'id_msg_last_visit' => '373871',
'rc' =>
array (
'id' => 3,
'time' => 1647251083,
'reports' => '0',
'member_reports' => '0',
),
)
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Why is it only an issue when TinyPortal is installed is due to the fact that SMF redirects to the forum page if it doesn't know what the action does. (In most cases) so you wouldn't see it if that wasn't installed.

Why it's an issue now is most likely as the login auth has been changed around a bit for SMF 2.1

@rjen

I guess that reporting it with SMF will not result in a fix, since it only acts up with TP.

Let's hope there are not many TP forums around that implemented a custom 404 message this way...
Running Latest TP on SMF2.1 at: www.fjr-club.nl