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
Post a Comment