I don't know, if the patch is an general php-cgi-solution, it works for me :)
Maybe the ez-team could point out cavehats, i'm not aware of.
UPDATE:
I noticed one cavehat!:
<form method="get".. does not work
U need to change the line to <form method="post"
i extended the preceding patch. Now it works with PHPSESSID encoded in the url.
Apply the first patch before you apply this one. This patch should be more general though, e.g. extract the path element dispite _any_ extra arguments.