Skip to content

Instantly share code, notes, and snippets.

@jeremysimmons
Created May 22, 2025 21:16
Show Gist options
  • Save jeremysimmons/4a74938290b3f27f92bb1d405e464a0f to your computer and use it in GitHub Desktop.
Save jeremysimmons/4a74938290b3f27f92bb1d405e464a0f to your computer and use it in GitHub Desktop.
extend woocommerce cart session cookie
add_filter('woocommerce_cookie_expiration', 'extend_woocommerce_cart_cookie_expiration');
function extend_woocommerce_cart_cookie_expiration($expiration) {
return 60 * 60 * 24 * 14; // 14 days in seconds
}
add_filter('auth_cookie_expiration', function($expire, $user_id, $remember) {
return 60 * 60 * 24 * 14; // 14 days
}, 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment