Page 1 of 2

Cannot send session cookie - headers already sent

Posted: Sun Mar 02, 2008 1:38 am
by cigsmh
Hi All,

My remository component doesn't work properly and as I was told it has something to do with cookies.
Recently I saw the following warnings on my Remository admin page, and I hope that you guys can tell me what is going on with my cookies.


Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/handyman/public_html/includes/joomla.php:4148) in /home/handyman/public_html/includes/joomla.php on line 800

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/handyman/public_html/includes/joomla.php:4148) in /home/handyman/public_html/includes/joomla.php on line 800

Thank you,

Igor

Re: Cannot send session cookie - headers already sent

Posted: Sun Mar 02, 2008 8:10 am
by dragonrider
You've an extra blank line on a php file that you've edited recently, possibly includes/joomla.php, but not necessarily.

If you've edited a php file, config or a remos file perhaps laterly, load it into an editor and see if there is a blank line either before the <?PHP or after the final ?> at the bottom of the page.

Some website editors do like to add an extra blank line each time you edit a php file in them!

Re: Cannot send session cookie - headers already sent

Posted: Sun Mar 02, 2008 10:47 am
by leolam
have you modified your system so it does not show any more globals=on?

please check for any blank lines at the end of your globals.php file and if so remove those

Leo

Re: Cannot send session cookie - headers already sent

Posted: Sun Mar 02, 2008 8:55 pm
by cigsmh
Thanks a lot. I will find the problem after your help

Re: Cannot send session cookie - headers already sent

Posted: Tue Mar 11, 2008 6:18 pm
by farmerdon
I was struggling with the above problem today.

I deleted the blank line at the end of my globals.php and everything is grand now.

Thanks for the post.

Re: Cannot send session cookie - headers already sent

Posted: Fri Mar 28, 2008 5:08 pm
by vijaip
I had this problem as well..Don't know if this will help. I was getting an intermediate page with an error between index.php and index2.php. It appears for only a few seconds ..So I took a screen shot of it..It referenced an error in class.phpmailer.php.

I fixed it by removing trailing empty lines in /includes/phpmailer/class.phpmailer.php and /includes/phpmailer/class.smtp.php

I also did the bit about placing the php.ini file in the root joomla folder and the administrator folder
see here for more info.
http://forum.joomla.org/viewtopic.php?f=34&t=269563

Re: Cannot send session cookie - headers already sent

Posted: Tue Jul 15, 2008 11:33 pm
by lima_fil
Just fix it.
I saved php file (edited with notepad) in ANSI format, not UTF-8 which was default.
SO if you dont have an extra blank line, you should try this one.
Pozzdrav

Re: Cannot send session cookie - headers already sent

Posted: Thu Sep 04, 2008 8:57 pm
by jokmok
A late post in this thread just to confirm that saving with Notepad using ANSI format as described above actually does help.

Thanks for the hint - it drove me nuts.
Jokmok

Re: Cannot send session cookie - headers already sent

Posted: Wed Mar 04, 2009 6:55 pm
by adde1966
-----------------------------------------------

Re: Cannot send session cookie - headers already sent

Posted: Fri Apr 17, 2009 8:24 am
by JonasJoomla
Att ändra till Ansi funkade pefekt

Re: Cannot send session cookie - headers already sent

Posted: Mon May 04, 2009 7:14 pm
by hopekiah
The following errors happened after finishing the last step in the joomla installation, which included deleting the installation folder and then creating a new configuration.php file from the text supplied in the last dialog box. I opened my site in joomla and got these errors:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by...

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at ...

Warning: Cannot modify header information - headers already sent by ...

I found this forum and decided to try saving the configuration.php file in a different way which was unicode utf8 no BOM and it worked!

Re: Cannot send session cookie - headers already sent

Posted: Sun Jun 14, 2009 1:24 am
by 287d
lima_fil wrote:Just fix it.
I saved php file (edited with notepad) in ANSI format, not UTF-8 which was default.
SO if you dont have an extra blank line, you should try this one.
Pozzdrav

thank you! fixed my j1.5 problem!

Re: Cannot send session cookie - headers already sent

Posted: Sat Jul 11, 2009 9:16 pm
by may_bailey
How can I find the globals.php file?? in which directory??

thnx

Re: Cannot send session cookie - headers already sent

Posted: Wed Jul 22, 2009 6:59 pm
by sakiss
Guys also check the encodings

i ve saved my configuration.php with UTF-8 and caused the above problem.

The problem solved when i changed it to ANSI

Re: Cannot send session cookie - headers already sent

Posted: Thu Dec 17, 2009 11:10 am
by Zaid101
This also Fixed my problem, Thank ssakiss

.. I saved my configuration.php using ITF8. now saved it on ANSI and its done...

Re: Cannot send session cookie - headers already sent

Posted: Tue Feb 16, 2010 9:25 pm
by cjmicro
saved my configuration.php with UTF-8 and caused the above problem.
The problem solved when i changed it to ANSI
Me too!! Thanks so much! 8)

Cheryl

Re: Cannot send session cookie - headers already sent

Posted: Fri Mar 26, 2010 8:29 pm
by ahmetkemal
Guys the problem is about the corrupted characters before <?php . Those appears when you changed encoding ANSII to UTF-8. Edit your configuration.php with a HEX editor or re-encode it with Notepad++ and select "Encode in UTF-8 without BOM"

Re: Cannot send session cookie - headers already sent

Posted: Wed Apr 14, 2010 5:38 am
by Suk Un
Hi,

I don't know if this helps, but I battled this problem for hours yesterday. Eventually, I figured out it was related to the length of the domain name.

I was installing a unix based virtual host and if I installed a fresh just downloaded latest version of Joomla on a domain that was 7 characters long, it would work, but if the domain was longer such as another domain I had that was 10 characters long it would not work.

It drove me crazy, until eventually I installed another copy of joomla in another directory on my shorter domain and copied the joomal directory to the longer domain name once it was configured.

This seems to do the trick for me, hope this helps.

Suk Un

Re: Cannot send session cookie - headers already sent

Posted: Wed Apr 14, 2010 7:30 am
by Suk Un
Okay, that wasn't as good as an idea as I thought.

When you want to install any extensions, etc it referers to the original location I installed it in.

Anyone else figured out how to fix this issue?

Re: Cannot send session cookie - headers already sent

Posted: Thu May 27, 2010 10:52 am
by saviola
ahmetkemal wrote:Guys the problem is about the corrupted characters before <?php . Those appears when you changed encoding ANSII to UTF-8. Edit your configuration.php with a HEX editor or re-encode it with Notepad++ and select "Encode in UTF-8 without BOM"
Yes that's right. I had the same problem and i was quite confuse. After a lot of research i found this information then i fixed the problem.

I hope that this will save you time and frustration.

Re: Cannot send session cookie - headers already sent

Posted: Fri Jun 04, 2010 4:24 pm
by randyenicholas
I am having this problem:


Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/syna2358/public_html/index.php:1) in /home/syna2358/public_html/libraries/joomla/session/session.php on line 423

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/syna2358/public_html/index.php:1) in /home/syna2358/public_html/libraries/joomla/session/session.php on line 423

Warning: Cannot modify header information - headers already sent by (output started at /home/syna2358/public_html/index.php:1) in /home/syna2358/public_html/libraries/joomla/session/session.php on line 426


I have not edited any files - this just happened out of the blue on four completely separate Joomla installations.

Any ideas?

Re: Cannot send session cookie - headers already sent

Posted: Fri Jun 04, 2010 4:39 pm
by randyenicholas
re: Previous post

I check the file the error is referencing, but there doesn't seem to be anything wrong with it, and it's encoded properly. I've never opened this file before. I'm lost.

Re: Cannot send session cookie - headers already sent

Posted: Fri Jun 04, 2010 4:45 pm
by saviola
Just for clarity, this troubles coming from something effort which try to print something!

Probably this is bug In Joomla.
You can post this bug here Joomla! 1.5.x Bug Tracker.
If you want to try to fix it you can debug your files and watch for mistakes described in link in my post above.

Re: Cannot send session cookie - headers already sent

Posted: Fri Jun 04, 2010 4:58 pm
by randyenicholas
But why would it start just out of the blue on some installations and not others? And on installations that have been untouched and working fine for months?

Re: Cannot send session cookie - headers already sent

Posted: Tue Jun 15, 2010 11:47 pm
by achieverzain
Thanks that changing the file format of the configuration file had resolved my issue as well.

Re: Cannot send session cookie - headers already sent

Posted: Tue Jun 22, 2010 1:08 pm
by pgtips
Thank you so much. Saving as ANSI worked for me too. I had edited config file in Dreamweaver so not sure if that's where it became UTF-8. Must start using notepad++

Re: Cannot send session cookie - headers already sent

Posted: Sat Jun 26, 2010 1:48 am
by idkdaa
This worked for me...thought I would clarify a bit
  • Open your configuration.php file in "htdocs/website" with notepad++
    On the menu bar, drop down "encoding", change it from Encode in UTF-8 to Encode in ANSI
    Save the file
    Restart Apache
    Profit!
Thanks all!

Re: Cannot send session cookie - headers already sent

Posted: Tue Jul 20, 2010 6:56 pm
by rizn
you can also encode to this in Notepad++ like ahmetkemal said:
UTF8 without BOM

for special chars! äöü

Re: Cannot send session cookie - headers already sent

Posted: Mon Aug 02, 2010 12:34 pm
by hardy_ali
i had the same problem..i solved by checking my joomla version and download its stable patch package. unzip then i upload and replaced two files in the same dir in root and /administrator for index.php ....

all the best

Re: Cannot send session cookie - headers already sent

Posted: Mon Oct 11, 2010 12:09 pm
by bachmahoangtu
Last week, I changed my host and I have some error with my site. Here my
error:
Warning: session_start() [function.session-start]: Cannot send session
cache limiter - headers already sent (output started at
/home/binhminh/public_html/index.php:2) in
/home/binhminh/public_html/libraries/joomla/session/session.php on line 422

Warning: Cannot modify header information - headers already sent by (output
started at /home/binhminh/public_html/index.php:2) in
/home/binhminh/public_html/libraries/joomla/session/session.php on line 424
I have already save session.php and configuration.php to utf8 without Bom,
and re_install languguage file such as mod_gtranslate and vietnamese
language for joomla. But these error can not fix. Please help me.

My email: quan1607@gmail.com.