Make WordPress Core

#59796 closed defect (bug) (invalid)

Undefined constant "SECURE_AUTH_COOKIE"

Reported by: thdr's profile thdr Owned by:
Milestone: Priority: normal
Severity: blocker Version: 6.3.2
Component: General Keywords:
Focuses: Cc:

Description

Hello,
I'm using php-fpm 8.2.7 nginx/1.22.1 and
get the following Error:


Undefined constant "SECURE_AUTH_COOKIE" in wordpress-dir/wp-includes/pluggable.php:925
Stack trace:
#0 wordpress-dir/wp-includes/pluggable.php(690): wp_parse_auth_cookie()
#1 wordpress-dir/wp-includes/class-wp-hook.php(308): wp_validate_auth_cookie()
#2 wordpress-dir/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#3 wordpress-dir/wp-includes/user.php(3620): apply_filters()
#4 wordpress-dir/wp-includes/pluggable.php(70): _wp_get_current_user()
#5 wordpress-dir/wp-content/plugins/contact-forms-builder/classes/core.php(55): wp_get_current_user()
#6 wordpress-dir/wp-content/plugins/contact-forms-builder/wpdevart-form.php(73): wpdevartForms->construct()
#7 wordpress-dir/wp-settings.php(398): include_once('...')
#8 wordpress-dir/wp-config.php(102): require_once('...')
#9 wordpress-dir/wp-load.php(50): require_once('...')
#10 wordpress-dir/wp-blog-header.php(13): req" while reading response header from upstream, client: 52.167.144.188, server: lyrifant.de, request: "GET /2022/11/30/adventsstimmung-2022/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php-fpm.sock:", host: "--my-wordpress"


I added a Workaround to get wp running:
--- pluggable.php.bu 2023-11-02 12:42:12.400966593 +0000
+++ pluggable.php.changed 2023-11-02 12:55:06.946493670 +0000
@@ -926,6 +926,10 @@
break;
default:
if ( is_ssl() ) {
+ if (!defined('SECURE_AUTH_COOKIE')) {
+ require_once('default-constants.php');
+ wp_cookie_constants();
+ }
$cookie_name = SECURE_AUTH_COOKIE;
$scheme = 'secure_auth';
} else {

Change History (1)

#1 @johnbillion
15 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Thanks for the report @thdr. Looking at the stack trace for the error, the root cause of this problem is that the contact-forms-builder plugin is calling wp_get_current_user() too early in the loading process, before WordPress has fully initialised. You should report this problem to the authors of the contact-forms-builder plugin.

Regards and good luck

Note: See TracTickets for help on using tickets.