title: How to set/get session values from javascript
body: <p>I want to access to session in javascript code so as to set and get some values :
  i try with this code :</p>
  
  <pre><code>function getsessionvalue() {
  
      var value= '&lt;%= session["role"].ToString() %&gt;';
      alert(value);
      //var role1= '&lt;%= session["role"] %&gt;'; **the same mistake**
      //alert(role1);     
  }
  </code></pre>
  
  <p>but i have these javascript mistakes for both :</p>
  
  <pre><code>The type of the expression must be an array type but it resolved to 
  Type mismatch: cannot convert from String to int
  </code></pre>