cookie create with php can't be read in wordpress -


i create simple cookie

the cookie there, exists, can't read inside wordpress shortcode or function.

php cookie_create.php

$data = $_post['v1']; setcookie( 'namecookie', $data, time() + 3600); 

inside wordpress try read it

function.php or in main file of plugin.

if(isset($_cookie['namecookie'])) {   echo "all right"; } else { echo "something wrong";  } 

no matter do, prints else

wordpress has it's own cookie functions. using make things simpler: how can set, , destroy cookies in wordpress?


Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -