<?php $_COOKIE['visit_pages'] = array( 'cookie_1' => 'heelo', 'cookie_2' => 'woot?', 'cookie_3' => 'michaeljacsooon', 'cookie_4' => 'itisworking?' ); //cookie set? //if(isset($_COOKIE['visit_pages']) && count($_COOKIE['visit_pages']) > 0){ //check if is of array type if(is_array($_COOKIE['visit_pages'])){ foreach($_COOKIE['visit_pages'] as $k=>$v){ $visit_pages = $v + 1; unset($_COOKIE['visit_pages'][$k]); setcookie("visit_pages[$k]", $visit_pages, time()+(60*60*24*365),"/"); $visit_pages_arr[$k] = $visit_pages; var_dump($_COOKIE['visit_pages']); } } else { //is not array? print 'Is not array type!'; } //} ?> Results: array (size=3) 'cookie_2' => string 'woot?' (length=5) 'cookie_3' => string 'michaeljacsooon' (length=15) 'cookie_4' => string 'itisworking?' (length=12) array (size=2) 'cookie_3' => string 'michaeljacsooon' (length=15) 'cookie_4' => string 'itisworking?' (length=12) array (size=1) 'cookie_4' => string 'itisworking?' (length=12) array (size=0) empty