so trying integrate logging in via facebook in website. because people not wish use facebook can use our website's logging in system, have create way set cookies , sessions. there want create cookies , session variables facebook users well.
however, error :
warning: cannot modify header information - headers sent (output started @ /home/content/88/10590088/html/test4/index.php:9) in /home/content/88/10590088/html/test4/login.php on line 144 warning: cannot modify header information - headers sent (output started @ /home/content/88/10590088/html/test4/index.php:9) in /home/content/88/10590088/html/test4/login.php on line 145 and line 145 , line 144 last 2 lines below:
// create sessions , cookies $_session['userid'] = $db_id; $_session['username'] = $db_username; setcookie("id", $db_id, strtotime( '+30 days' ), "/", "", "", true); setcookie("user", $db_username, strtotime( '+30 days' ), "/", "", "", true);
the problem cookies , sessions set sending headers browser.
can find great explanation why happens here.
you cannot modify headers when there sent, have html code or blank spaces between line 9 , line 144, try remove them if there or try move line 144-145.
otherwise try using methods ob_flush.(place before line 144)
Comments
Post a Comment