|
Posted by Kimmo Laine on 06/08/06 09:11
"yawnmoth" <terra1024@yahoo.com> wrote in message
news:1149751294.421301.16080@j55g2000cwa.googlegroups.com...
>
> Paul Lautman wrote:
>> yawnmoth wrote:
>> <snip>
>> The headers are sent as soon as some output is sent. In your case you are
>> sending a blank followed by the text random text, before doing the
>> session_start().
> Why isn't the ini_set preventing that, though? I don't want PHP to
> propogate PHPSESSID via $_COOKIE - I want it to propogate through
> $_GET.
>
> I could just do it via .htaccess or php.ini, but doing so would still
> leave me wondering why ini_set doesn't work. As far as I know, it
> should, yet it doesn't, and I'd like to know why.
Ini_set doesn't work that way because it's never meant to work that way in
the first place. It doesn't affect the way headers and body are sent. once
you start sending the body, session information cannot be sent, headers were
already sent. When you close the first php tag, the random text is echoed
out to client. That's when headers are sent and sending body begins.
After ini_set you might want to call ob_start() if you want the output to be
buffered. Then you should be able to set session variables later because
output doesn't begin until ob_flush() is called or page ends.
--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|