如何在正确的路径中设置cookie?

classlogin.php

/*set cookies*/
            $cookie_name = 'check[user]';
            $cookie_value = 'check[authID]';

            // start set cookie //
            //** cookie need to change right away after user press login**//
            setcookie($cookie_name,$value,time()+(60*60*24),'','','',TRUE);
            setcookie($cookie_value,$valueID,time()+(60*60*24),'','','',TRUE);

index.php

<?php
print_r($_COOKIE);
?>

my folder root.

root

-->class-->classlogin.php(set cookie here>


-->directory-->index.php(check cookie here>

my intetion is to set cookie at classlogin.php , i checked $_COOKIE at classlogin.php , it exits.

but when i try to access cookie at index.php , it was empty, i search online it said my cookie need to have a domain name ? so i can access there. but i tried many domain noting work.

can anyone help me ? how i set my cookie in right path ? i am using wamp localhost.