title: How to access session variable from JavaScript file (.js) file?
body: <p>I have to access session variable from <code>javascript</code> file</p>
  
  <p>I am using below code to access from <code>javascript</code>,</p>
  
  <pre><code>var sessionValue = '&lt;%=Session["username"]%&gt;'
              alert(sessionValue)
  </code></pre>
  
  <p>it is working well when the script function is placed inside the <code>aspx page</code>...but when I use the same code in <code>.js</code> file it is not working </p>
  
  <p>I have seen all the related answers, nothing is useful for me, so don't mark it as duplicate</p>