Thanks for reaching out, will check on this.
I tried in my server and staging but I cannot see the error.
Are you able to provide me your Site Health? by going to Tools -> Site Health -> Info
Or try editing this line to see if it works. (replace “init” with “plugins_loaded” on line 62)
From: add_action( ‘init’, ‘dnd_cf7_generate_cookie’ );
To: add_action( ‘plugins_loaded’, ‘dnd_cf7_generate_cookie’ );
If not remove empty space the top after <?php see this : https://snipboard.io/yrf5hq.jpg
Please let me know how it goes, thanks.
Thread Starter
Mati
(@mattheus)
Hello @glenwpcoder
I want to share the data but not make it public here because it contains sensitive data. Can I email it?
I tried the code changes but nothing helped
Seems to be on
setcookie( ‘wpcf7_guest_user_id’, $guest_id, time() + 3600 * 12, ‘/’ );
// Generate cookie
function dnd_cf7_generate_cookie() {
if ( ! isset( $_COOKIE['wpcf7_guest_user_id'] ) ) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen( $characters );
$randomString = '';
for ( $i = 0; $i < 12; $i++ ) {
$randomString .= $characters[ random_int( 0, $charactersLength - 1 ) ] ;
}
$guest_id = $randomString .'-'. mt_rand(1000, 9999);
setcookie( 'wpcf7_guest_user_id', $guest_id, time() + 3600 * 12, '/' );
}
}
@mattheus @moviero
Try to change the code on line 62.
From: add_action( ‘init’, ‘dnd_cf7_generate_cookie’ );
To: add_action( ‘send_headers’, ‘dnd_cf7_generate_cookie’ );
Please let me know how it goes.
Hello guys, are you going to change line 62 at next update?
@nikosmdtps yes, it will be included.
Thanks a lot for your response!