General Community > Scripting Help

storing cookie's value in variables

(1/1)

Saleh:
I was trying to store the cookie in a variable to make it easy to work with ...
I stored an array in the cooike but when I try to call one element from it it doesn't work ...
I tried this :
<?php $info=$_COOKIE["APFEG[position]"]; ?>
but it says undefined index , info ...
what should I do ?! how can I fix this ?
and btw I used print_r($_cookie) and it worked and printed the array ...

[Unknown]:
It's not:
$_COOKIE["APFEG[position]"];

You should do it this way:
$_COOKIE['APFEG']['position'];

-[Unknown]

Navigation

[0] Message Index

Go to full version