note 66974 added to function.session-register

From: Date: Thu, 01 Jun 2006 20:10:00 +0000
Subject: note 66974 added to function.session-register
Groups: php.notes 
Request: Send a blank email to php-notes+get-112824@lists.php.net to get a copy of this message
Make sure you put session_start() at the beggining of your script. My sessions kept unsetting and I finally figured out why. On my script, session_start() has to be said and uses cookies to set the session. But I was outputting html prior to calling session_start(), which prevented it from succeeding becouse it uses the header function to place the cookies. Once html has been outputed, session_start() can't use the header function to set cookies, hence session_start() fails and no session can be started. ---- Server IP: 64.71.164.2 Probable Submitter: 131.216.45.187 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.session-register.php Edit -- http://master.php.net/note/edit/66974 Del: integrated -- http://master.php.net/note/delete/66974/integrated Del: useless -- http://master.php.net/note/delete/66974/useless Del: bad code -- http://master.php.net/note/delete/66974/bad+code Del: spam -- http://master.php.net/note/delete/66974/spam Del: non-english -- http://master.php.net/note/delete/66974/non-english Del: in docs -- http://master.php.net/note/delete/66974/in+docs Del: other reasons-- http://master.php.net/note/delete/66974 Reject -- http://master.php.net/note/reject/66974 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#112824) next »