Home New Guten Forums WoodMart support forum Change woodmart cookie runtime/storage duration

Change woodmart cookie runtime/storage duration

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #400640

    Silence
    Participant

    Hello!

    When a guest adds an item to the wish list on our website, two cookies are stored for this purpose in the browser for 7 days.

    We would like to change the duration of the following two cookies for privacy reasons. Both cookies should be deleted automatically when the browser is closed. They are to be treated as session cookies.

    • woodmart_wishlist_count:”id”
    • woodmart_wishlist_products:”id”

    Question:
    What code do I need to add to functions.php to change the runtime or storage duration of the two cookies?

    Thanks for your effort!

    Best regards

    #400864

    Hello,

    Unfortunately, there is no option. You can add this custom code to the functions.php of the child theme:

    if ( ! function_exists( 'woodmart_update_session_expiration' ) ) {
    	function woodmart_update_session_expiration() {
    		return DAY_IN_SECONDS;
    	}
    
    	add_filter( 'woodmart_session_expiration', 'woodmart_update_session_expiration' );
    }

    If you have any questions please feel free to contact us.

    Best Regards

Viewing 2 posts - 1 through 2 (of 2 total)