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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
43 + 29 = ?
Subscribe to this entry?

 
 [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 May 02 08:01:32 2024 UTC