Make WordPress Core

Opened 17 years ago

Closed 16 years ago

#4996 closed enhancement (fixed)

Allow control over setting commenter cookies

Reported by: viper007bond's profile Viper007Bond Owned by: westi's profile westi
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.3
Component: General Keywords: has-patch commit
Focuses: Cc:

Description

Plugins and/or themes should be able to control whether cookies get set when a commenter adds a comment.

For example:

A plugin could add a checkbox to the comment form saying like "Remember my information" and it'd only set the cookie if the checkbox was checked. Then the user can control if they want cookies or not set.

Attached patch makes this possible.

Attachments (2)

wp-comments-post.patch (1.6 KB) - added by Viper007Bond 17 years ago.
wp-comments-post.2.patch (1.6 KB) - added by Viper007Bond 17 years ago.
Cleaner code

Download all attachments as: .zip

Change History (8)

@Viper007Bond
17 years ago

Cleaner code

#1 @westi
17 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

#2 @ffemtcj
17 years ago

  • Milestone changed from 2.5 to 2.6

#3 @Denis-de-Bernardy
16 years ago

I don't like this idea much. anything that adds UI elements should be avoided, including on the front end. If the commenter is savvy enough to not want to be remembered, he will block the site's cookies.

#4 @Denis-de-Bernardy
16 years ago

  • Keywords commit added; 2nd-opinion removed
  • Milestone changed from 2.9 to 2.8

nm that, I hadn't tried read the patch. :-)

#5 @westi
16 years ago

Nice idea.

Even simpler patch for it though, which is also more flexible.

Sample plugin code

function kill_comment_cookies()
{
	return -1;
}

add_filter('comment_cookie_lifetime', 'kill_comment_cookies');

#6 @westi
16 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [11223]) Allow a plugin to vary the comment cookie lifetime (or even remove the cookies altogether). Fixes #4996.

Note: See TracTickets for help on using tickets.