How to set Dynamic Variable in Session and Cookies in Wordpress
<p>I am trying to store dynamic variable from external link <code>?dynamic=a_12_bc</code> and put into the link look like this <code>http://www.myweb.com?tracker=a_12_bc</code> 
First time it always show the dynamic link but when i refresh and click on other page it shows <code>?tracker=[object][Object]</code>.</p>

<pre><code>&lt;?php session_start(); 
 echo $_GET['dynamic'];
if( isset($_GET['dynamic']))
{
  $cookie_name = "dynamic";
  $cookie_value = $_GET['dynamic'];
  setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/");
  $_SESSION["dynamic"] = $cookie_value;
  }
else
{   
 $_SESSION["dynamic"] = $_COOKIE['dynamic'];
 }?&gt;
 Button Link
&lt;a href="https://www.myweb.com/?tracker=&lt;?php echo($_SESSION['dynamic']);?&gt;" target="_blank"&gt;LOG IN&lt;/button&gt;&lt;/a&gt;
</code></pre>

<p>Can you please tell me how to maintain a session on other pages</p>