So I am trying to integrate logging in via facebook in my website. Because people who do not wish to use facebook can use our website's logging in system, we have create a way to set cookies and sessions. There i want to create cookies and session variables for facebook users as well.
However, I get this error :
Warning: Cannot modify header information - headers already sent by (output started at /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 already sent by (output started at /home/content/88/10590088/html/Test4/index.php:9) in /home/content/88/10590088/html/Test4/login.php on line 145
and line 145 and line 144 are the last 2 lines below:
// CREATE THEIR SESSIONS AND 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);