php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5363 problem with class and HTTP_COOKIE_VARS
Submitted: 2000-07-04 20:26 UTC Modified: 2000-07-05 10:36 UTC
From: jorge at ctyd dot com dot mx Assigned:
Status: Closed Package: Other
PHP Version: 4.0.0 OS: Linux Red Hat 6.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jorge at ctyd dot com dot mx
New email:
PHP Version: OS:

 

 [2000-07-04 20:26 UTC] jorge at ctyd dot com dot mx
 If i try to get the vaule of a cookie inside the class, the command
HTTP_COOKIE_VARS return "" but if the same command run outside the class
return the correct value

Example

Archivo userctl.inc
<? 

class userctl {
  
    function userctl() {
      print $HTTP_COOKIE_VARS["ctl_user_cookie"];    // return ""
    }

?>

Archivo test.phpA
<?
   include("./userctl.inc");
   $user = new userctl;
   print $HTTP_COOKIE_VARS["ctl_user_cookie"];    //return "value"
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-05 10:36 UTC] stas at cvs dot php dot net
Use global $HTTP_COOKIE_VARS.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 02:01:32 2025 UTC