Connecting Tech Pros Worldwide Help | Site Map

session issues

camou
Guest
 
Posts: n/a
#1: Jan 27 '06
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
Guest
 
Posts: n/a
#2: Jan 27 '06

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
Carl Vondrick
Guest
 
Posts: n/a
#3: Jan 28 '06

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_only_cookies
is set to true.

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

s a n j a y
Guest
 
Posts: n/a
#4: Jan 28 '06

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
Closed Thread