значение cookie не меняется на текст из строки
я пытаюсь делать так чтобы у Cookie accname менялось значение на то которое ты ввёл из input, но оно не хочет меняться почему то.
<?php
$json_data34 = file_get_contents("accounts/".$_COOKIE['id'].".json");
$products245 = json_decode($json_data34, true);
$json_data34ach = file_get_contents("accounts/".$_COOKIE['id']."ach.json");
$products245ach = json_decode($json_data34ach, true);
if(isset($_POST['jojo'])){
$json_data34 = file_get_contents("accounts/".$_COOKIE['id'].".json");
$products245 = json_decode($json_data34, true);
unlick('API/name_id/'.$_COOKIE['accname'].'.json');
setcookie('accname', $_POST['homes']);
}
echo $products245[$_COOKIE['id']][$_COOKIE['accname']]['Name'].'<br>';
echo $products245[$_COOKIE['id']][$_COOKIE['accname']]['Avatar'];
?>
<form method="POST"><input name="homes" type="text"><input name="jojo" type="submit"></form>
<?php
print_r( $_COOKIE);
?>
Я не могу понять что я не так делаю