Disable woocommerce cookies and delete cart data automatically

Your code is expiring the session after 24 hours. You need to change your return value to reflect the number of hours (commented in the example below): add_filter(‘wc_session_expiring’, ‘so_26545001_filter_session_expiring’ ); function so_26545001_filter_session_expiring($seconds) { return 60 * 60 * 1; // Change “1” to the number of hours: 1 for 1 hour, 4 for 4 hours, … Read more

Nonce failing on form submission

Okay, not sure what was wrong with my original code, but this post put me on the right path. To generate the nonce, use: wp_nonce_field( plugin_basename( __FILE__ ), ‘my_reset_nonce’,true,false); To verify, use: if ( ! isset( $_POST[‘my_reset_nonce’] ) || ! wp_verify_nonce( ( $_POST[‘my_reset_nonce’] ), plugin_basename( __FILE__ ) ) ) { die; } else { // … Read more