|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-04-20 22:30 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 11:00:01 2025 UTC |
Description: ------------ The constant SID is not defined if a session is started with $_SESSION['bla'] = 'dummy'. So you have to call session_start to get the SID constant. But a call to session_start will kill a session that was already started with $_SESSION['bla'] ='dummy'. Reproduce code: --------------- // register globals is off error_reporting(E_NOTICE); $_SESSION['dummy'] = 'started'; echo '<pre>'; echo "session data before call to session_start:\n"; print_r($_SESSION); echo "SID is defined before call to session_start? " . (defined('SID') == true?'yes':'no'); echo "\n"; session_start(); echo "SID is defined after call to session start? " . (defined('SID') == true?'yes':'no'); echo "\n"; echo "session data after call to session_start:\n"; print_r($_SESSION); exit; Expected result: ---------------- SID should be defined when a session is started with $_SESSION and session_start should handle the call to itself as if it was called twice when $_SESSION is used. Actual result: -------------- session data before call to session_start: Array ( [dummy] => started ) SID is defined before call to session_start? no SID is defined after call to session start? yes session data after call to session_start: Array ( )