Okay so I'm running this script to set a cookie with the same name as the username of the person who logs in, but when I check my cookies after I run the script, the only cookie that is set from the host I am working with is named 'PHPSESSID' instead of the username entered. What am I doing wrong?
PHP Code:
require('db.php');
if(
$_SERVER["REQUEST_METHOD"] == "POST"){
    
$returned=$db->query("SELECT * FROM basic WHERE username='".$_POST["username"]."' and pass='".$_POST["password"]."'");
    
$returned->execute();
    
$row=$returned->fetchAll(PDO::FETCH_ASSOC);
    if(
count($row)==1){
        
$results=$row[0];
        
$username=$results['username'];
        
setcookie($username,'mp'.$username,60,'/','localhost',false,true);
        
session_start();
        
header('location: profile.php?username='.$username);
    }else{
$message='no match found';}