php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22757 querystring variables has changed after session_register()
Submitted: 2003-03-18 00:22 UTC Modified: 2003-03-18 11:09 UTC
From: audwox at chol dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.1 OS: redhat linux 7.3
Private report: No CVE-ID: None
 [2003-03-18 00:22 UTC] audwox at chol dot com
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) "spamadmin@snu.ac.kr"
  ["pwd"]=>
  NULL
  ["name"]=>
  NULL
  ["group"]=>
  NULL
  ["server"]=>
  NULL
  ["init"]=>
  NULL
}

But, Sometimes it gives to me wrong result:

array(6) {
  ["email"]=>
  &string(19) "spamadmin@snu.ac.kr"
  ["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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-18 08:38 UTC] audwox at chol dot com
I found some same bug report in this site.
 [2003-03-18 11:09 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.

.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 05:01:34 2025 UTC