php - SetCookie not working in WordPress -


i cannot cookie set through wordpress theme. putting following code on top of header.php page theme:

<?php     error_reporting(e_all);     ini_set("display_errors", 0);     if(!$_get['c_id'])     {           $locationcookie =  $_cookie['aboutlocations'];         if($locationcookie)         {             $state = $locationcookie['state'];             $city = $locationcookie['city'];         }     }     else     {         $state = $_get['c_id'];         $city = $_get['cid'];     }        setcookie("aboutlocations[state]",               $state,time()+3600*24*100,               cookiepath, cookie_domain );     setcookie("aboutlocations[city]",               time()+3600*24*100,               cookiepath, cookie_domain); ?> 


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -