php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12815 session does not set value inside function
Submitted: 2001-08-17 12:49 UTC Modified: 2001-08-17 12:51 UTC
From: jcastro at elnuevodia dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.0.6 OS: W2K
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: jcastro at elnuevodia dot com
New email:
PHP Version: OS:

 

 [2001-08-17 12:49 UTC] jcastro at elnuevodia dot com
I do not know if this is a bug or if I am doing something very wrong

<?
session_start();
session_register("sess_uid");
$sess_uid=1; //THIS WORKS

function foo(){
   $sess_uid=2; // WHY WHY WHY IT DOES ---NOT--- WORK
   echo "<a href='next.php'>Continue</a>";
}
foo();
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-17 12:51 UTC] derick@php.net
Read the piece about variabeles and scopes in the manual.
This is not a bug.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 20:01:34 2025 UTC