Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4791 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85016 invoked by uid 1010); 11 Oct 2003 03:27:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 84992 invoked from network); 11 Oct 2003 03:26:59 -0000 Received: from unknown (HELO mail.rocketservers.net) (64.246.52.103) by pb1.pair.com with SMTP; 11 Oct 2003 03:26:59 -0000 Received: (qmail 19276 invoked from network); 11 Oct 2003 03:30:46 -0000 Received: from unknown (HELO work) (127.0.0.1) by localhost with SMTP; 11 Oct 2003 03:30:46 -0000 To: internals@lists.php.net Content-Type: text/plain Message-ID: <1065842818.3599.23.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.0 Date: 10 Oct 2003 22:26:58 -0500 Content-Transfer-Encoding: 7bit Subject: $_SESSION questions From: jsjohnst@altdns.net (Jeremy Johnstone) I have recently found that if I don't register a session using PHP's session management code I can use the $_SESSION variable as "my own" superglobal which I can use for whatever purpose I deam fit. Here is a small code snippet to illustrate: $_SESSION = new my_custom_session_obj(); function test_session() { print($_SESSION->loginvars["username"]); } test_session(); Works fine. Of course there is no autosaving of the session as PHP normally does, but this is fine as I already have code to do this. My question is this a "bug" or a "feature". I don't want to use this code if it is not an officially supported usage as it would obviously not be very backwards compatible and also not useable in new versions of PHP. If anyone can tell me approximately when this started to work (have tested in several 4.3.x builds already) and if it's expected to work in the future I would greatly appreciate it. Jeremy