note 9934 deleted from function.session-start by jimw

From: Date: Fri, 07 Dec 2001 20:24:43 +0000
Subject: note 9934 deleted from function.session-start by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-21893@lists.php.net to get a copy of this message
yar@warlock.ru, see http://www.php.net/manual/function.setcookie.php for a possible explanation of your problem. According to that page, "Cookies must be sent before any other headers are sent (this is a restriction of cookies, not PHP). This requires you to place calls to this function before any <html> or <head> tags." It sounds like if you call session_start() before the head and body tags, SID will not be set because you've successfully set a cookie. But if you call session_start() later, setting the cookie will fail and PHP will fall back on SID. The recommended method is to consistently place your session_start() at the very top of the document so that it can properly interact with cookie-enabled browsers. Hope that helps... Arlo Leach www.typea.net

« previous php.notes (#21893) next »