JosephLenton / PHP-Error

Better error reporting for PHP, and prettier too!
1.35k stars 151 forks source link

session_start() throws warning if its already started before php_error is loaded. #43

Closed truckingsim closed 11 years ago

truckingsim commented 11 years ago

This change fixes that, and will still start the session if it isn't started.

JosephLenton commented 11 years ago

If statement has been updated, to start if the session_id is empty, and there is a cookie.

The if statement however cannot just be ...

if ( session_id() === "" ) {

... because that will always start a new session, if there is no session already, ever. That could lead to unpredictable behaviour, if someone hits an error in their code, and then starts building their session management code (the browser has a session before they wrote that bit).