Warning: session_start() [function.session-start]: Cannot send session cookie

I'm just starting php and test page was working but now getting
Warning: session_start() [function.session-start]: Cannot send session cookie

I just made some minor edits and now its not working.

No votes yet

Replies

that worked

thank you sorry for not submitting the code but your sample explained my problem I had added some html before the session_start()

Your rating: None Average: 5 (1 vote)

session_start

You should post some of your code so we can see whats causing it but most likely you are outputting something to the page before session_start() is called. Certain function calls like header and session must be called before any output to the page. This includes whitespace so

<html>
<?php
session_start
();

?>

</html>

Would be invalid as there can be no text or anything (whitespace) output until after these have been called.

Your rating: None Average: 5 (1 vote)

Post new comment

 
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><code>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.