Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Location
    Lahore, Pakistan
    Posts
    150
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Cannot Send Session Cookie Error

    Hi,

    My project works well offline, today i upload to a server, but on some pages it gives the following error

    session_start(): Cannot send session cookie - headers already sent by (output started at D:\vhosts\abc.com\httpdocs\ant\header1.php:9) in D:\vhosts\abc.com\httpdocs\ant\viewcart.php on line 6

    Kindly tell me that how can i solve this issue.

    Regards,
    Eshban

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That means that on some pages you are sending data to the browser before you try to se the cookie. This isn't allowed, if you send ANY data to the browser, even if you just have one single linebreak or whitespace before your <?php tag then you cannot send headers and this error will be generated.

    If the project is working offline but not online, it could be that your host is inserting something which is causing the headers to be sent before your code is executed, or it could be that the error level is set differently in your home and server environments and the error is just being hidden when you try to view the page offline. It's impossible to pinpoint the cause though without seeing some code.


  •  

    Posting Permissions

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