diff --git a/wp-comments-post.php b/wp-comments-post.php index ef49b8875..6e7cdef10 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -48,9 +48,11 @@ $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_emai wp_new_comment($commentdata); -setcookie('comment_author_' . COOKIEHASH, stripslashes($comment_author), time() + 30000000, COOKIEPATH); -setcookie('comment_author_email_' . COOKIEHASH, stripslashes($comment_author_email), time() + 30000000, COOKIEPATH); -setcookie('comment_author_url_' . COOKIEHASH, stripslashes($comment_author_url), time() + 30000000, COOKIEPATH); +if ( !$user_ID ) : + setcookie('comment_author_' . COOKIEHASH, stripslashes($comment_author), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); + setcookie('comment_author_email_' . COOKIEHASH, stripslashes($comment_author_email), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); + setcookie('comment_author_url_' . COOKIEHASH, stripslashes($comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); +endif; nocache_headers();