yesterday my cookies were setting just fine, but today, by cookies wont set at all, I haven't changed anything, NOTE: i am using a custom version of sql thingy.
<?php
include($_SERVER['DOCUMENT_ROOT'].'/phpAlphaDB/core.php');
include('../config.php');
error_reporting(0);
db_create('xenozweb-users');
session_start();
if (isset($_POST['login'])) {
//write post data in variables
$username = $_POST['username'];
$password = md5($_POST['password']);
$results = db_read('xenozweb-users', 'username='.$username, 'username password ');
foreach ($results as $result) {
$data_username = db_column($result, 0);
$data_password = db_column($result, 1);
$data_role = db_column($result, 2);
if ($data_password !== "") { break; }
}
if ($data_username == $username && $data_password == $password) {
setcookie('xenozweb_id1', $data_username, time() + (40000 * 3), "/");
setcookie('xenozweb_id2', $data_password, time() + (40000 * 3), "/");
header("Location: https://xenozweb.tk/loggedin.php");
} else {
echo '<script>alert("Invalid username or password.");</script>';
}
}
?>
I am getting the following warnings:
Warning: strpos(): Empty needle in /var/www/html/phpAlphaDB/core.php on line 181
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/phpAlphaDB/core.php:181) in /var/www/html/login/index.php on line 19
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/phpAlphaDB/core.php:181) in /var/www/html/login/index.php on line 20
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/phpAlphaDB/core.php:181) in /var/www/html/login/index.php on line 21