Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Jun 2008
    Posts
    14
    Plugin Contributions
    0

    Default Cannot send session cookie - headers already sent

    I am getting the following errors when i try to log into my admin page (and several more when the log in fails).

    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/hopemiss/public_html/theprickcushion.com/##########_admin/includes/application_top.php:2) in /home/hopemiss/public_html/theprickcushion.com/includes/functions/sessions.php on line 108

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/hopemiss/public_html/theprickcushion.com/##########_admin/includes/application_top.php:2) in /home/hopemiss/public_html/theprickcushion.com/includes/functions/sessions.php on line 108

    Warning: Cannot modify header information - headers already sent by (output started at /home/hopemiss/public_html/theprickcushion.com/##########_admin/includes/application_top.php:2) in /home/hopemiss/public_html/theprickcushion.com/##########_admin/includes/init_includes/init_templates.php on line 37


    I have followed all the suggestions in this faq https://www.zen-cart.com/tutorials/index.php?article=87 and on this thread http://www.zen-cart.com/forum/showthread.php?t=72252. I have even tried deleting the file and doing it over from scratch.

    There are no blank lines, hidden characters or double spaces in line 2 of the application_top file. There are no blank lines at the beginning or the end of the php. I am stumped.

    The problem showed up a few days after I changes the header in my newsletter and removed it from my outgoing email. I am not sure if this is related but it is the only recent change I have made to the site, other than updating the text blurb on the main page (via the internal zencart editor, not via true code).

    Please help. It has been almost a week since I could get into my zencart admin page!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Cannot send session cookie - headers already sent

    What's on line 2 of that application_top.php file? How does that compare with the original version of that file from the original Zen Cart files? And why is it different?
    And remember, the error message is talking about your ADMIN version of application_top, not the non-admin version. The files are not the same.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2008
    Posts
    14
    Plugin Contributions
    0

    Default Re: Cannot send session cookie - headers already sent

    Line 2 says "/**"

    For context, here are the first 10 lines

    <?php
    /**
    * @package admin
    * @copyright Copyright 2003-2007 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: application_top.php 7544 2007-11-29 04:40:11Z drbyte $
    */
    /**
    * File contains just application_top code

    I have been checking the file in the admin folder. I am not sure how it differs from the original... I had never opened this file up until I started to get the error message last week. I did the cut and paste as suggested in the previously linked forum thread as a last ditch effort.

  4. #4
    Join Date
    Jun 2008
    Posts
    14
    Plugin Contributions
    0

    Default Re: Cannot send session cookie - headers already sent

    As of right now, I am getting a the same error message, but it is referencing a different file :

    initsystem.php

    I have not made any changes to merit a change in warning. Warnings as followed


    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/hopemiss/public_html/theprickcushion.com/##########_admin/includes/initsystem.php:2) in /home/hopemiss/public_html/theprickcushion.com/includes/functions/sessions.php on line 108

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/hopemiss/public_html/theprickcushion.com/##########_admin/includes/initsystem.php:2) in /home/hopemiss/public_html/theprickcushion.com/includes/functions/sessions.php on line 108

    Warning: Cannot modify header information - headers already sent by (output started at /home/hopemiss/public_html/theprickcushion.com/##########_admin/includes/initsystem.php:2) in /home/hopemiss/public_html/theprickcushion.com/##########_admin/includes/init_includes/init_templates.php on line 37

  5. #5
    Join Date
    Jun 2008
    Posts
    14
    Plugin Contributions
    0

    Default Re: Cannot send session cookie - headers already sent

    Went and looked at the initsystem file and now i am getting a new error message (i made no changes to the init file)

    /home/hopemiss/public_html/theprickcushion.com/includes/classes/shopping_cart.php:2d is the "new source" of the problem.

    I think my zencart is laughing at me right now.

  6. #6
    Join Date
    Jun 2008
    Posts
    14
    Plugin Contributions
    0

    Default Re: Cannot send session cookie - headers already sent

    Looks like opening whatever file it says the problem is in, and doing nothing to the code, is enough to make the problem jump to another file. It has just told me it is in 3 other locations.
    Always line 2.

    I can't win.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Cannot send session cookie - headers already sent

    It sounds like you're altering those files when you touch them, and your editor is inserting extra lines in those files. That's a very common bad side-effect of using browser-based editors such as those offered by the FileManager in cPanel, or with incompatible editors like those written by Microsoft.

    And, if you're not actually editing those files, then something bad is happening between your computer and the files on your website. Since that's something outside the control of Zen Cart, you'll need to interact with the people at your hosting company to figure out what's damaging the files on your server.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jun 2008
    Posts
    14
    Plugin Contributions
    0

    Default Re: Cannot send session cookie - headers already sent

    But the problem is reported in the file before i open the file. Thus how can my opening the file cause the problem?

    And how do i know where the problem really is?

  9. #9
    Join Date
    Jun 2008
    Posts
    14
    Plugin Contributions
    0

    Default Re: Cannot send session cookie - headers already sent

    Opening the files in ultra edit is showing black lines on line one... but where are these blanks coming from?

    They are all files i have never opened before. I have had to remove the line from 6 different files this morning. None have I ever opened before. And it seems like it is going to keep naming new files with the same problem. how many hundreds of files will I have to do this to if File Manager has added it to every file? Are they going to come back again if i upload via file manager? I have no other option because I am using campus internet.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Cannot send session cookie - headers already sent

    Sounds like the tools you're using are damaging the files, and are thus unsuitable.
    Uploading and editing via the cPanel FileManager is strongly discouraged because of these sort of problems it causes.
    Using a regular FTP program such as FileZilla is a far more reliable method.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Cannot send session cookie / Cannot modify header information
    By witch-of-germany in forum General Questions
    Replies: 9
    Last Post: 10 Apr 2011, 01:00 AM
  2. cannot modifyheader headers already sent
    By Maria Claudia in forum Addon Payment Modules
    Replies: 4
    Last Post: 4 Feb 2010, 04:42 PM
  3. Replies: 4
    Last Post: 12 Dec 2008, 04:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg