title: How can I set a session var using javascript and get it via php code
body: <p>I have a javascript code like this :</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      $('#editRole').on('show.bs.modal', function (e) {  
  
          $roleID =  $(e.relatedTarget).attr('data-id');
          // Here I want to set this $roleID in session may be like this :
          Session['roleID'] = $roleID;                      
      });    
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Then I want to get that $roleID in an other place using php code, may be like this :</p>
  
  <pre><code>&lt;?php $roleID = Session::get('roleID'); //do something ....  ?&gt;
  </code></pre>
  
  <p>Thanks</p>