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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 17:01:29 2024 UTC