-$comment = get_comment($comment_id);
-if ( !$user->ID ) {
- setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
- setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
- setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
+$comment_id = wp_new_comment( $commentdata );
+if ( ! $comment_id ) {
+ wp_die( __( "<strong>ERROR</strong>: The comment could not be saved. Please try again later." ) );