Re: losing session variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/6/07, Alain Roger <raf.news@xxxxxxxxx> wrote:
if i check before header command what is the value of $_SESSION['username'],
i get the right value.
however, if i place on the first line of welcome.php file the following code
:

echo "<br>1. Before session";
> session_start();
> echo"<br>Username : ".$_SESSION['username'];
> echo "<br>2. After session";
>

i get empty value for this session variable.
How is it possible ?

You have to execute the session_start method before any data have been
sent to the client. You are sending data to the browser with 'echo
"<br>1. Befor Session";'

--
Saludos
Oscar

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux