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

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

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

asp.net mvc - breakpoint on javascript in CSHTML? -