I have not even tried to use algebra filter for years but it looks like your problem comes from the first tags in algebradebug.php - in moodle 1.9 (and previous versions)
$nomoodlecookie = true; // Because it interferes with caching
and in moodle 2
define('NO_MOODLE_COOKIES', true); // Because it interferes with caching
You can delete these lines or set them false.
Algebra filter is a sort of sub filter of Tex filter that is using some custom syntax to render Tex with help of Perl script algebra2tex.pl and executable Mimetex file from Tex filter - see some examples of syntax from http://moodle.org/mod/forum/discuss.php?d=5402
As you can see algebra filter is not at the moment working here in moodle.org - most likely for missing permissions to execute either that perl script or mimetex.linux because moodle.org is using today Texlive binaries.
I have a couple of times wished that algebra filter could be removed from core packages and it could be downloaded separately from modules and plugins database for those sites that still want to use it