Re: Sessions - session_start()

From: Date: Mon, 15 May 2006 14:33:19 +0000
Subject: Re: Sessions - session_start()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-236205@lists.php.net to get a copy of this message
Den 06-05-15 15.56, skrev "nicolas figaro" <nfigaro@sdv.fr>: > Jonas Rosling a écrit : >> Hi, >> I've been building a site with PHP 5 on my develop machine. I've been woring >> alot with session handling. For example I've been using session_start() now >> and then depending on where the user/vistor are or are doing. >> But now I've moved the site to a host server with PHP 4.3.8 and now I keep >> getting error messages all the time where I use session_start(). The error >> message looks like this: >> >> Warning: session_start(): Cannot send session cookie - headers already sent >> by (output started at /var/www/html/index.php:9) in /var/www/html/index.php >> on line 82 >> >> But I found out that if I put the tag in the absolute top of every page it >> seems to work. But then I need to do alot of changes on all the pages. >> >> Does anyone know if there's any workaround for this? >> >> Thanks in advance // Jonas >> >> > check in your code if there is a print or echo somewhere. > *http://www.php.net/manual/en/function.session-start.php : > Note: * If you are using cookie-based sessions, you must call > *session_start()* before anything is outputted to the browser. > > N F Will take a look at the echos. It'll be some rewriting though. Thanks // Jonas

« previous php.general (#236205) next »