session-start – headers already sent

This happens when you try to start session more than once.

[php]
The solution for above problem is

1) in php.ini file set session.autostart to 0

session.auto_start = 0

2) Placing a .htaccess file in the root of your web directory with the following value:

php_flag session.auto_start 0

3) In your code use this line

if (!session_id()) session_start();

instead of

session_start();
[/php]

Permanent link to this article: https://blog.openshell.in/2011/10/1263/

Leave a Reply

Your email address will not be published.