Zeka Posted January 16, 2020 Share Posted January 16, 2020 Hi. I get logged out when I try to save a page which contains emojis like ?, but fields are saved. Then when I try to log in back on the same URL I get 'This request was aborted because it appears to be forged.' I tested it on several setups. Could somebody confirm the issue? Setup: PW 3.0.148 InnoDB utf8mb4_general_ci Link to comment Share on other sites More sharing options...
flydev Posted January 17, 2020 Share Posted January 17, 2020 I cannot confirm this, no problem on my side with the "same" setup 1 Link to comment Share on other sites More sharing options...
Zeka Posted January 17, 2020 Author Share Posted January 17, 2020 @flydev ?? Thanks. Any ideas where to look? Link to comment Share on other sites More sharing options...
dragan Posted January 17, 2020 Share Posted January 17, 2020 Check your mySQL collation / encoding type maybe. Is it anything else than utf8? I always choose utf8_general_ci. Link to comment Share on other sites More sharing options...
flydev Posted January 17, 2020 Share Posted January 17, 2020 You could check in first instance the mysql server settings and adjust them in the config file my.cnf : [client] default-character-set = utf8mb4 [mysql] default-character-set = utf8mb4 [mysqld] character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci character-set-client-handshake = FALSE Then restart the server and try to save a page with an emoji. Link to comment Share on other sites More sharing options...
flydev Posted January 17, 2020 Share Posted January 17, 2020 (edited) 6 minutes ago, dragan said: I always choose utf8_general_ci. For storing emoji, utf8mb4 is required as each emoji consist of four bytes in UTF-8 and you cannot store them using MySQL utf8 implementation as it can only symbols that consist of one to three bytes. Edited January 17, 2020 by flydev ?? precisions Link to comment Share on other sites More sharing options...
Jan Romero Posted November 27, 2021 Share Posted November 27, 2021 Hey @Zeka, did you ever solve this? I’m seeing the same problem now, after switching to PHP 8. The page is saved successfully, but PW logs me out in the next request (the redirect after POST). Only happens when emoji are present. Edit: Did you run Tracy Debugger by any chance? For me it seems to happen only when Tracy is enabled. Link to comment Share on other sites More sharing options...
Zeka Posted November 27, 2021 Author Share Posted November 27, 2021 Hi @Jan Romero Yes, I've solved it, but I don't remember what actually was causing this problem. What is your collation / encoding type? Have you tried to set $config->dbCharset = 'utf8mb4'; 1 Link to comment Share on other sites More sharing options...
Jan Romero Posted November 27, 2021 Share Posted November 27, 2021 Thanks for the quick response! Yeah, everything is set to utf8mb4, gotta have my emoji ??? I’m also using InnoDB, btw, but I feel like if it were a database issue I would either see corrupted data or an actual error in the logs. Anyway, I’m leaning towards this being some sort of exotic Tracy/PHP 8/mb4 bug. Guess I’ll try going back to PHP 7 to confirm that suspicion and see if I can narrow it down somehow. Unless in your case Tracy and PHP 8 weren’t involved? In the end it doesn’t trouble me too much, because non-superusers seem unaffected… Link to comment Share on other sites More sharing options...
Zeka Posted November 27, 2021 Author Share Posted November 27, 2021 9 minutes ago, Jan Romero said: Thanks for the quick response! Yeah, everything is set to utf8mb4, gotta have my emoji ??? I’m also using InnoDB, btw, but I feel like if it were a database issue I would either see corrupted data or an actual error in the logs. Anyway, I’m leaning towards this being some sort of exotic Tracy/PHP 8/mb4 bug. Guess I’ll try going back to PHP 7 to confirm that suspicion and see if I can narrow it down somehow. Unless in your case Tracy and PHP 8 weren’t involved? In the end it doesn’t trouble me too much, because non-superusers seem unaffected… it definitely was php7... something 1 Link to comment Share on other sites More sharing options...
Jan Romero Posted November 29, 2021 Share Posted November 29, 2021 Sorry to unearth this thread again, but I must apologise. It was indeed a collation thing. I had only checked the relevant field tables, but after switching everything except field_password to mb4, the problem disappeared. The issue must have started when my hoster migrated from MySQL to MariaDB months ago, because I’m sure I originally installed PW with mb4, but apparently I didn’t notice until after switching to PHP 8 recently. Probably because earlier I didn’t run Tracy constantly. Not sure how exactly it was implicated, but it was entirely my fault anyway ? Just wish I had had some hints in the logs. Eventually I got an SQL collation exception when purposely searching for an emoji in the Admin, but never with the random logouts. Anyway, glad to have this thread! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now