Jump to content

[SOLVED] why session_start() [function.session-start]: Cannot send session cookie ???


new_php85

Recommended Posts

why the system that i develop can run at my pc but after put on server i have this warning

 


Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/XXXXX/public_html/XXXXXClaim/db_connect.php:10) in /home/XXXXX/public_html/XXXXX/index.php on line 3

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/XXXXX/public_html/XXXXXClaim/db_connect.php:10) in /home/XXXXX/public_html/XXXXXClaim/index.php on line 3

 

i already go to a forum that have same problem but it still not working

 

this is link for the forum http://www.php-forum.com/phpforum/viewtopic.php?f=2&t=9229

 

Link to comment
Share on other sites

The short answer is that you cannot output anything before setting a cookie or starting a session, not even whitespace, unless you use ob_start()/ob_flush() which isn't really advisable.

 

yes there some whitespace at my code. i have change my code and now the warning disappear.  ;)thank for help  :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.