Home › Forums › WoodMart support forum › Mark cross-site cookies as Secure to allow setting them in cross-site contexts
Mark cross-site cookies as Secure to allow setting them in cross-site contexts
- This topic has 4 replies, 2 voices, and was last updated 2 years, 9 months ago by Artem Temos.
-
AuthorPosts
-
January 25, 2022 at 12:57 pm #347792
gadsParticipantHi, This problem has been around for about 2 months. I tried many ways, I did research on your forum, but I could not reach a result.
January 25, 2022 at 1:50 pm #347827
gadsParticipantwoodmart/inc/integrations/woocommerce/modules/compare.php:54
setcookie( $cookie_name, json_encode( $products ), 0, COOKIEPATH, COOKIE_DOMAIN, false, false );
to change this
setcookie( $cookie_name, json_encode( $products ), 0, COOKIEPATH, COOKIE_DOMAIN, true, false );
this problem is solved.
January 25, 2022 at 1:57 pm #347829
gadsParticipantWishlist samesite error ;
woodmart/inc/integrations/woocommerce/modules/wishlist/functions.php:60
setcookie( $name, $value, $expire, COOKIEPATH, COOKIE_DOMAIN, false, false );
to change this
setcookie( $name, $value, $expire, COOKIEPATH, COOKIE_DOMAIN, true, false );
for child functions.php;
//Wishlist samesite giderir. if ( function_exists( 'woodmart_set_cookie' ) ) { /** * Set cookies. * * @since 1.0.0 * * @param string $name Name. * @param string $value Value. */ function woodmart_set_cookie( $name, $value ) { $expire = time() + intval( apply_filters( 'woodmart_session_expiration', 60 * 60 * 24 * 7 ) ); setcookie( $name, $value, $expire, COOKIEPATH, COOKIE_DOMAIN, true, false ); $_COOKIE[ $name ] = $value; } } //Karşılaştırdaki samesite error sorununu çözer. if ( function_exists( 'woodmart_add_to_compare' ) ) { /** * Add product to comapre * * @since 3.3 */ function woodmart_add_to_compare() { $id = sanitize_text_field( $_GET['id'] ); if ( defined( 'ICL_SITEPRESS_VERSION' ) && function_exists( 'wpml_object_id_filter' ) ) { global $sitepress; $id = wpml_object_id_filter( $id, 'product', true, $sitepress->get_default_language() ); } $cookie_name = woodmart_compare_cookie_name(); if ( woodmart_is_product_in_compare( $id ) ) { woodmart_compare_json_response(); } $products = woodmart_get_compared_products(); $products[] = $id; setcookie( $cookie_name, json_encode( $products ), 0, COOKIEPATH, COOKIE_DOMAIN, true, false ); $_COOKIE[$cookie_name] = json_encode( $products ); woodmart_compare_json_response(); } add_action( 'wp_ajax_woodmart_add_to_compare', 'woodmart_add_to_compare' ); add_action( 'wp_ajax_nopriv_woodmart_add_to_compare', 'woodmart_add_to_compare' ); }
- This reply was modified 2 years, 9 months ago by gads.
January 25, 2022 at 4:21 pm #347856
gadsParticipantLatest page speed(Litespeed) and samesite error fix.
Mobile
Desktop
Attachments:
You must be logged in to view attached files.January 26, 2022 at 9:31 am #347992
Artem TemosKeymasterHello,
Thank you for contacting us!
We will review your fix and implement it in our next theme update. Thank you for the report.
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register