title: How to Access Ruby Session Variable in Javascript
body: <p>I have created <code>Ruby Session Variable</code> I need to access this variable in <code>Javascript</code></p>
  
  <p>Lets take this scenario</p>
  
  <p><code>session[:note]</code> = <code>'Some Notes'</code> this is done in <code>Ruby on Rails</code></p>
  
  <p>Now I want to access this is like</p>
  
  <p>var session_val = js-code for access above session variable.</p>
  
  <p>its not js.erb I know if it is js.erb we can access like </p>
  
  <pre><code>var sesion_val = "&lt;%= session[:note] %&gt;"
  </code></pre>
  
  <p>TIA</p>