session issues

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • camou

    #1

    session issues

    I cannot under this error message and how I may resolve it. Any help
    appreciated. It appears when I combine Smarty with session_start

    Warning: Cannot modify header information - headers already sent by
    (output started at /home/ ...
  • Jonathan

    #2
    Re: session issues

    camou wrote:[color=blue]
    > I cannot under this error message and how I may resolve it. Any help
    > appreciated. It appears when I combine Smarty with session_start
    >
    > Warning: Cannot modify header information - headers already sent by
    > (output started at /home/ ...[/color]

    It means that data (page output) was already sent to the c;ient browser
    before the session_start command is given.

    Ths ession_start command should appear before any output is done,
    usually at the top of the script.

    Jonathan

    Comment

    • Carl Vondrick

      #3
      Re: session issues

      Jonathan wrote:[color=blue]
      > It means that data (page output) was already sent to the c;ient browser
      > before the session_start command is given.[/color]

      Not exactly. It means that the session_start() call was sent after
      output (as you said) and in the php.ini file, session.use_onl y_cookies
      is set to true.

      So, the solution: move the session_start() call to the top (recommended)
      or change session.use_onl y_cookies to be 0.

      Comment

      • s a n j a y

        #4
        Re: session issues

        camou wrote:[color=blue]
        > I cannot under this error message and how I may resolve it. Any help
        > appreciated. It appears when I combine Smarty with session_start
        >
        > Warning: Cannot modify header information - headers already sent by
        > (output started at /home/ ...[/color]


        Well this actually means that the some sort of data is already sent to
        the client browser before session_start has been called. So you can do
        one thing, make sure you do not have any print, echo statements before
        session_start. It can not be even a blank html line.

        hope this helps.

        Sanjay

        Comment

        Working...