From:             audwox at chol dot com
Operating system: redhat linux 7.3
PHP version:      4.3.1
PHP Bug Type:     Session related
Bug description:  querystring variables has changed after session_register()

First, I'm sorry my poor english.

I'm try below code...

<?
    $req = $_REQUEST;
    $q[email] = strtolower($req[email]);
    $q[pwd] = $req[pwd];
    $q[name] = $req[name];
    $q[group] = $req[group];
    $q[server] = $req[server];
    $q[init] = $req[init];

    session_start();

    $sess_email = $q[email];
    $sess_name = $q[name];
    $sess_permission = 1;
    $sess_lastaccesstime = $now;
    session_register("sess_email");
    session_register("sess_name");
    session_register("sess_permission");
    session_register("sess_lastaccesstime");

    $isLoginSuccess = true;

    print "<xmp>";
    var_dump($q);
    print "</xmp>";
?>

And this is right result:

array(6) {
  ["email"]=>
  string(19) "[EMAIL PROTECTED]"
  ["pwd"]=>
  NULL
  ["name"]=>
  NULL
  ["group"]=>
  NULL
  ["server"]=>
  NULL
  ["init"]=>
  NULL
}

But, Sometimes it gives to me wrong result:

array(6) {
  ["email"]=>
  &string(19) "[EMAIL PROTECTED]"
  ["pwd"]=>
  &bool(true)
  ["name"]=>
  &bool(true)
  ["group"]=>
  &bool(true)
  ["server"]=>
  &bool(true)
  ["init"]=>
  &bool(true)
}

If I first access this page with web browser or after delete session
information file in /tmp/sess*, php give to me wrong result.

But use var_dump() before session working, it was show right result.

Thank you.
-- 
Edit bug report at http://bugs.php.net/?id=22757&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22757&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22757&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22757&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22757&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22757&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22757&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22757&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22757&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22757&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22757&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22757&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22757&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22757&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22757&r=gnused

Reply via email to