add_filter( 'setcookie_options', function( $options, $name ) { $options['samesite'] = 'Lax'; // Or 'Strict' $options['secure'] = true; // Only allow over HTTPS $options['httponly'] = true; // Hide from JavaScript return $options; }, 10, 2 ); ?>