You are here: Re: ini_set() not working as expected « PHP Programming Language « IT news, forums, messages
Re: ini_set() not working as expected

Posted by Paul Lautman on 06/08/06 09:52

Kimmo Laine wrote:
> "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.
But the manual does say: "If you are using cookie-based sessions, you must
call session_start() before anything is outputted to the browser."

Which implies that if you are not using cookie-based sessions, then you can
call session_start() after sending output to the browser.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация