We have code that handles cookies (for recording anonymous flaggings on cached pages).

Most unfortunately, this code is very tough to maintain. We have two [nearly] duplicated chunks of code (causing bugs like this one and time waste when "comparing" texts when bugs are discovered). The "implementation details" are strewn all over the place (causing bugs like this one). It's hard not to break this code. And if somebody will ever want to change the "implementation details", the result will be patches sitting here, "needs review", for months/years.

This patch solves all of this.

It factors out the cookie storage to a PHP class.

The code seems bigger now, but it's mostly due to empty lines and comments. (If we were restricted to D7, we could put this in a separate .inc file which PHP would autoload; However, there's D6 to support.)

CommentFileSizeAuthor
cookies-abstract.diff8.9 KBmooffie

Comments

mooffie’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.