php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #11404 Session Error
Submitted: 2001-06-11 15:12 UTC Modified: 2001-06-17 04:43 UTC
From: lnc_18 at yahoo dot com dot ar Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.5 OS: Red-Hat Linux 7.1
Private report: No CVE-ID: None
 [2001-06-11 15:12 UTC] lnc_18 at yahoo dot com dot ar
When you create a variable in a method or function, the session it's created ok, but when you assign value to this session variable in a function or method, the global program, have not this value, Why? beacause you must to tell php that the session variable is GLOBAL.
Bug? I think that is a bug, beacause a Session Variable must be a GLOBAL variable.

Example:

<?php
class foo
         {
           function foo()
               {
                session_register("count");
                $count++;
               }
         };
$MyClass = new foo();
echo (session_is_registered("count")) 
// This print that is registered. This is Oka

echo($count);
// This print ""; (nothing)


I think that this the error, I repeat: "When you define a session variable, de assignment must be global to."

Do you Understand.


Sorry if it's not a bug.. I think that this is.
Sorry for My "poor" english I'm from Argentina

?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-17 04:43 UTC] jmoore@php.net
Not a bug. would not be nice behaviour anyway. lets leave it as it is.

- James
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 05 20:01:29 2025 UTC