Cookie error. No possibility to define my cookie

You are missing the path parameter.
Try setcookie( 'panier', $cookie_user_id, time() + DAY_IN_SECONDS, "https://wordpress.stackexchange.com/");

Also, don’t put the callback function in a conditional, put the conditional statement inside the function.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)