session_start() has to be called on every page where you want to use the session, before you try referencing it - you also have to call it before outputting anything else (you must be doing it after and this is what is causing your error)
----- Original Message ----- From: "Børge Strand" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, September 29, 2002 6:12 PM Subject: [PHP] calling session_start() > > Hi All, > > When does session_start() have to be called? I have the following > setting: > > A bunch of php pages are placed in a frameset. If someone tries to > access one of these pages without the session-id cookie being set, the > page calls a reloading of the frameset. The frameset page itself is > the first to call session_start() > > Am I right to believe that session_start() has to be called before one > can do if (!isset($_SESSION['foo']))? It is this test that determines > whether or not to reload the frameset. > > On my development system this works just fine, but going into > production on a web hotel, I get a lot more warnings. Every page in > the frameset says "Warning: Cannot send session cache limiter - > heaaders already sent..." in response to session_start() in the test I > described above. > > Which setting in php.ini enables this warning? > Do you know how I can test for the presense of a session without > getting this error? > > Regards, > > Børge > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php