title: How to set javascript variable to php session variable
body: <p>Whats the best way to do this?</p>
  
  <p>I have this <code>$_SESSION["sessionOpentok"]</code> I need to set to  this java script var <code>var session_id</code></p>
  
  <p>Security isn't an issue, its okay for the end user to be able to see this session id.</p>
  
  <p>I have heard of AJAX calls, json encode, delimiters, php echo, php print.</p>
  
  <p>None seems to work. echo and print do not work due to quote being in the session variable.</p>
  
  <p>JSON encode encodes this the number to a null.</p>
  
  <p>Any ideas. Thanks</p>