Bug #73456 [NEW]: Problems on unsetting session variable
From: sasf54 at gmail dot com
Operating system: Linux - Gentoo
PHP version: 7.0.12
Package: Session related
Bug Type: Bug
Bug description:Problems on unsetting session variable
Description:
------------
I have a shopping cart.
With unlogged in user, I cannot clean it.
(unset($_SESSION['order']);
session_commit();)
But with a logged in user, it works fine.
(it has some other session variables)
I fixed the bug, with issuing an other session_start() right before the
unset block.
Test script:
---------------
// I cannot give you the whole code part :(
// I set the $_SESSION['order'] in an other php file, and it's working
fine
session_start();
// some long processing codeing
if (isset($_SESSION['order'])) {
session_start(); // <=== this has to be here to work,
without it, does not works
unset($_SESSION['order']);
session_commit();
}
Expected result:
----------------
the $_SESSION['order'] to be unset
(For unlogged in user, it should be an empty session,
for a logged in user, it works fine 'o,O' )
Actual result:
--------------
It should clear the $_SESSION['order'] for unlogged in users too.
(I also tried to add some new values to other session variables to save
it, but it was not working :( )
--
Edit bug report at https://bugs.php.net/bug.php?id=73456&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73456&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73456&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73456&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73456&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73456&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73456&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73456&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73456&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73456&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73456&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73456&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73456&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73456&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73456&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73456&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73456&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73456&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73456&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73456&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73456&r=mysqlcfg
Thread (5 messages)
- sasf54 at gmail dot com