wp_signon()
function):setcookie
headers are not sent in the page response. I still have a “logged successfully” message displayed but in reality the cookies are not set at all.This occurs at \js-support-ticket\includes\classes\wphdsession.php line 60.
My quick patch is to make it conditional:
if (!headers_sent()) {
setcookie( ‘_wpjshd_session_’, $this->sessionid . ‘/’ . $this->sessionexpire . ‘/’ . $this->nextsessionexpire , $this->sessionexpire, COOKIEPATH, COOKIE_DOMAIN);
}
Would be nice to have a fix so my change is not erased when the next update is made.
]]>define( ‘WP_SAMESITE_COOKIE’, ‘None’ );
Could anyone advise if I write something wrong in the code?
]]>We are on a multi-container setup with Pantheon.io and we are using their PHP Native Sessions plugin as they recommend. However we get this error:
[20-Feb-2020 14:17:42 UTC] PHP Warning: session_set_save_handler(): Cannot change save handler when headers already sent in /srv/bindings/8d918e0d30a24a8ebe5a9aaa627a1706/code/wp-content/plugins/wp-native-php-sessions/pantheon-sessions.php on line 163
The reason I’m writing here is because after looking through plugin and theme code on our website, Yoast SEO utilizes a Session handler in the following directory:
wp-content\plugins\wordpress-seo-premium\vendor_prefixed\guzzlehttp\guzzle\src\Cookie\SetCookie.php
I believe that this might cause issues with the session setting and I wanted to have your input on this and if it indeed is a PHP Session manager.
Sincerely,
Andreas
]]>Here is the code for the basic function:
add_shortcode("SC-PVT", "sc_pvt_sc");
function sc_pvt_sc(){
if(isset($_COOKIE['scvttest'])) {
echo "Cookie is set!<br>";
} else {
echo "Cookie is NOT set!<br>";
$res = setcookie("scvttest","1234",0,"/",$_SERVER['HTTP_HOST']);
if ($res){
echo "-- TRUE --";
} else {
echo "-- FALSE --";
}
}
}
]]>Line 310 in woocommerce-postfinancecheckout.php generates the following warning, filling the PHP error log.
PHP Warning: Cannot modify header information – headers already sent by (output started at wp-cron.php:28) in wp-content/plugins/woo-postfinance-checkout/woocommerce-postfinancecheckout.php on line 310
Could this be fixed?
Thank you
]]>Warning: setcookie() expects parameter 3 to be integer, float given in /home/www/wp-content/plugins/wpclef/includes/lib/wp-session/class-wp-session.php on line 130
Clef login works apparently, but still this error looks a bit annoying…
https://www.ads-software.com/plugins/wpclef/
]]>However, to satisfy some requirements I needed to set the secure and httponly flags for setcookie to true. It accepts the value for httponly but everytime I set the secure flag to true the “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.” message appears.
Anybody here who have tried to set these parameters or tried to modify the setcookie lines also and encountered this error message? Have you found a solution or if you have an idea why this error keeps on occurring?
Thanks.
]]>I’m using Polylang 1.1.5 on my website. And on this website I got 3 languages: German, English and French. If I am on my home site in German, switch to English home site and then click on another menu item, it opens this menu item, but it goes back to German language.
Is this a cookie error? I really don’t know what to do and I don’t have a plan^^ Can you help me or give me a hint? Thanks
Cheers
https://www.ads-software.com/plugins/polylang/
]]>This plugin uses the function for toggling between the mobile and full view. I would really like to regain this functionality, but I need an alternative to the setcookie function.
Any ideas would be very helpful!
Thanks in advance.
https://www.ads-software.com/extend/plugins/wpms-mobile-edition/
]]>