note 55278 added to function.session-start

From: Date: Fri, 29 Jul 2005 02:48:02 +0000
Subject: note 55278 added to function.session-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-92683@lists.php.net to get a copy of this message
here's a peculiarity: $array = array( 'foo' => 'bar', ); session_start(); $_SESSION = $array; exit; //$_SESSION is now a copy of $array... // and the session file is created.. however it's a zero length file. instead of $_SESSION = $array; gotta use: foreach ( $array as $k => $v ) $_SESSION[$k] = $v; might save a bit of frustration not sure what the reason for this flaky behavior is ---- Submitter IP: 12.160.245.96 ---- Manual Page -- http://www.php.net/manual/en/function.session-start.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55278 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55278&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55278&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55278&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55278&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55278&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55278&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55278&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#92683) next »