A
A
Alexander2017-06-23 20:13:44
linux
Alexander, 2017-06-23 20:13:44

Accepting cookies. Why is it returning an array?

If I send a cookie with the name "visitCounter" - returns an array. And if, for example, with the name "user" - returns the value "John". Confused.

setcookie("visitCounter", "John");

$visitCounter = $_COOKIE['visitCounter'];

echo $visitCounter; // Array

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MechanicZelenyy, 2018-11-24
@MechanicZelenyy

Perhaps this is a subjective opinion, but ASUS is not the most Linux-friendly manufacturer, so to fix problems with hardware, you will need a long and tedious digging in forums, manuals and configs

M
My joy, 2017-06-23
@t-alexashka

$_COOKIE is a super-global array like $_POST and $_GET and anything that starts with $_
do print_r($_COOKIE); and see what it shows. This is an associative an array with cookies, the keys of which are the names of the cookies, and the values ​​are respectively. cookie values.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question