Jump to content

Question on Sessions

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
shiyam198

shiyam198

    Newbie

  • Members
  • PipPip
  • 16 posts
John | Please use [code],

Now, in all the pages I have, i have included the following code segment,


where the passwords.php is


Question:

In those pages I already had two includes so I uncluded the code segment after that.

Like this:

When I did that, I got the following error message.
[quote]
"session_start(): Cannot send session cache limiter - headers already sent[/quote] (output started at top.htm............"

I took the code segment out from all the pages and put on top of top.php, it works fine.

Why does that session_start() should be on top the file. Or is it some other problem caused this error ?

Thanks for your time
Shiyam
[B]John | [COLOR="Red"]Please use [code], [php], and [quote] tags when appropriate.

Edited by John, 03 September 2008 - 07:38 PM.


#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts

shiyam198 said:

When I did that, I got the following error message.
(output started at top.htm............"

I took the code segment out from all the pages and put on top of top.php, it works fine.

Why does that session_start() should be on top the file. Or is it some other problem caused this error ?

The cache limiter warning is issued when content is outputted prior to the session_start() directive being called. That said, it must be placed at the top of the page (or before you output any content). I'm not sure the reasoning behind it - I just accepted it.