note 49063 added to function.session-start
| From: | ryanch at gmail dot com | Date: | Sat, 15 Jan 2005 21:40:47 +0000 |
| Subject: | note 49063 added to function.session-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-83335@lists.php.net to get a copy of this message | ||
If your sessions based cookies are not being set, make sure you do not have any output before you
call session_start().
For example:
If you had this:
<?
echo "hi";
session_start();
?>
php would not send the cookie, and thereby your session would not be saved via the cookie.
A even more sneaky gothcha is if you have a single white space at the beginging of your file, before
your opening "<?".
----
Manual Page -- http://www.php.net/manual/en/function.session-start.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49063
Delete -- http://master.php.net/manage/user-notes.php?action=delete+49063&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49063&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+49063&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+49063&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+49063&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+49063&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49063&report=yes
Search -- http://master.php.net/manage/user-notes.php