As already noted, check if the cookie is really set in your browser (your syntax is displayed correctly).
Cookies will only be saved until you set them. I always used the year as a round period unless there are specific expiration requirements (which are usually much shorter).
Use the strtotime function to make them easier to read:
setcookie( "cookieName1", $value1, strtotime( '+1 year' ) ); setcookie( "cookieName2", $value2, strtotime( '+30 days' ) );
There are many examples of how to use them on the setcookie manual page, which is worth the time to read.
source share