[horde] test.php session unregister failed

François Helly francois.helly@wanadoo.fr
Sun Nov 3 17:23:37 2002


Here is a response to my pb,
hope it could be helpful

According to the man php page at
http://www.php.net/manual/en/ref.session.php#AEN81790

because of my config
(I use other php scripts on my server, a lot of them are created before php
4.1,...) 
I have my register_globals php_ini value sets to 1

So, the unset() function doesn't work at all because the variable is stored
in the $_SESSION array

Solutions are (at your conveniance):

A) modify the test.php as follow :

I made a correction in the test.php file (l. 231) :
and now it works perfectly :

+---------------------------------+

    case 'unregister':
        $register_globals = ini_get('register_globals');
        if (empty($register_globals)) {
            unset($_SESSION['horde_test_count']);
        } else {
            session_unregister('horde_test_count');
        }

+---------------------------------+

B) create a .htacces file in the horde's directory (if you don't have one
yet)
with such directive:

+---------------------------------+
php_value register_globals 0
+---------------------------------+


C) add the B) like directive in your http.conf
<Directory /path-to-horde/horde>
php_value register_globals 0
</Directory>


> De : François Helly <francois.helly@wanadoo.fr>
> Date : Sun, 03 Nov 2002 04:29:57 +0100
> À : <horde@lists.horde.org>
> Objet : [horde] test.php session unregister failed
> 
> Hi,
> 
> I run 
> 
> Horde 3.0-cvs ( a goldmine :)
> Apache 1.3.26
> PHP 4.2.3
> 
> on a linux box (mandrake 9.0)
> 
> and I noticed the session unregister in /horde/test.php doesn't work at a=
ll,
> the $_SESSION['horde_test_count'] isn't unset and still incrementŠ
>