#32279 [Opn]: _SESSION treated as super global without session_start()

From: Date: Sat, 12 Mar 2005 18:23:31 +0000
Subject: #32279 [Opn]: _SESSION treated as super global without session_start()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-75259@lists.php.net to get a copy of this message
ID: 32279 Updated by: tony2001@php.net Reported By: pguilbault at iweb dot ca Status: Open Bug Type: Session related PHP Version: 5.0.3 New Comment: Well, personally I don't think it's a bug. Other autoglobals are registered in the same time too (i.e. at module init time). Previous Comments: ------------------------------------------------------------------------ [2005-03-12 14:43:42] sniper@php.net Yes, it's definately a bug. And I wouldn't suggest using $_SESSION like that as we might a) fix this bug b) this won't work if session extension is not enabled.. ------------------------------------------------------------------------ [2005-03-11 15:54:38] pguilbault at iweb dot ca Description: ------------ Without using session_start() and setting $_SESSION['test']='hi there'; in a class and echoing thise $_SESSION['test'] outside the class with echo the 'hi there'... I was told it was a bug... Althougth I am hoping it is NOT a bug and that I will be able to use that super global for my Session Management class. So I can use $_SESSION['test'] in my classes instead of $GLOBAS['session_vars']['test']. which is way too long for my test. Reproduce code: --------------- class tester() { function __construct() { $_SESSION['test'] = 'hi there'; } } $test = new tester(); echo $_SESSION['test']; Expected result: ---------------- hi there ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32279&edit=1

« previous php.bugs (#75259) next »