Skip to content Skip to sidebar Skip to footer

Warning: Session_start(): Cannot Send Session Cookie - Headers Already Sent By (output Started At

The following warning comes in login page: Its working in localhost but not in remote host Warning: session_start() [function.session-start]: Cannot send session cookie - headers a

Solution 1:

Move the session_start(); to top of the page always.

<?php
@ob_start();
session_start();
?>

Solution 2:

  1. session_start() must be at the top of your source, no html or other output befor!
  2. your can only send session_start() one time
  3. by this way if(session_status()!=PHP_SESSION_ACTIVE) session_start()

Solution 3:

You cannot session_start(); when your buffer has already been partly sent.

This mean, if your script already sent informations (something you want, or an error report) to the client, session_start() will fail.

Post a Comment for "Warning: Session_start(): Cannot Send Session Cookie - Headers Already Sent By (output Started At"