title: How to get session variables in wordpress plugins
body: <p>Hi iam new to wordpress and I have created a plugin at which I need to print all the session data.First I have created a file in plugin folder and added code like</p>
  
  <pre><code>function myplugin_classname() {
      print_r($_SESSION);
  }
  </code></pre>
  
  <p>And I put an click event for two button with class <code>tags</code> like</p>
  
  <pre><code>$('.tags').on('click',function(){
       $.post('my_page.php',{val:$(this).val()});
  });
  </code></pre>
  
  <p>and in my_page.php I kept like</p>
  
  <pre><code>$_SESSION['tag'] = $_POST['val'];
  </code></pre>
  
  <p>but when it comes to printing the session variables at <code>myplugin_classname</code> (by refreshing the page)it doesnt prints the <strong>newly assigned session variable</strong>....How to solve this..??I have started session through <code>theme-my-login</code> login.</p>