#19380 [NEW]: Incorrect session handling

From: Date: Thu, 12 Sep 2002 19:40:36 +0000
Subject: #19380 [NEW]: Incorrect session handling
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-19259@lists.php.net to get a copy of this message
From:             ctenedor@yahoo.com
Operating system: linux redhat 7.2 (2.4.7-10)
PHP version:      4.2.3
PHP Bug Type:     Variables related
Bug description:  Incorrect session handling

It seems like unset function it's not working fine, when is used on
$_SESSION variables. My script uses an array containing a list of items,
and with a button, i clear that list (I only 'destroy' the variable, using
unset. When the scripts check again for the existence of $_SESSION and
isn't set, it's created, of course, empty)

/*Clear function (in file clear.php)*/

 if(isset($_POST['reset']))
 {
        unset($_SESSION['galery']);
 
 }
 header("location:showlist.php");


/*Show items in list (in file showlist.php)*/
session_start();
if(!isset($_SESSION['galery']))
   $_SESSION['galery']=array();
echo "List has ". count($_SESSION['gallery']) ." items";

This is only a sample. Supose that I have many lists, every of them
accessible by a link. When I click a link, it should show the items of
that collection, but it's not working, the session variable is not
destroyed, and every list, show the same content.

I'm not using global variables since 4.2.1. Some scripts working fine
become unstable when upgraded from 4.2.2 to  4.2.3

 './configure' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin'
'--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share'
'--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--with-config-file-path=/etc'
'--disable-debug' '--enable-pic' '--disable-path'
'--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs'
'--with-bz2'
'--with-db3' '--with-exec-dir=/usr/bin' '--with-gd'
'--with-gdbm'
'--with-gettext' '--with-jpeg-dir=/usr' '--with-mm'
'--with-openssl'
'--with-png' '--with-regex=system' '--with-ttf'
'--with-zlib'
'--with-layout=GNU' '--enable-debugger' '--enable-ftp'
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets'
'--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars'
'--enable-yp'
'--enable-wddx' '--with-mysql' '--with-xml'
'--with-png-dir=/usr/local/lib' '--with-pam_auth'
'--with-imap=/usr/src/imap/lib' '--with-ldap' '--with-ftp'
'--with-kerberos'

Cesar



-- 
Edit bug report at http://bugs.php.net/?id=19380&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=19380&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=19380&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=19380&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=19380&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=19380&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19380&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=19380&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=19380&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=19380&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=19380&r=globals



Thread (5 messages)

« previous php.bugs (#19259) next »