Answer the question
In order to leave comments, you need to log in
Why is the value of the variable not being injected into the cookie (PHP)?
I make a POST request to the server, I get a response like: {"response": {"user_id": "88"}}
Next, parse the response:
$obj = json_decode($result, true);
$response = $obj["response"];
$userid = $response["user_id"];
setcookie("user_id", $user_id, time() + 3600, '/');
$user_id = "2";
$user_id = (integer) $user_id;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question