title: Detect if a session variable exist after front-end user logs into SharePoint 2010
body: <p>Is there a JavaScript object, method or property that I can use to detect if a specific SharePoint session variable exist, after a font-end user log's into SharePoint?</p>
  
  <p>The following seems to work..</p>
  
  <pre><code>&lt;SharePoint:Delegate runat="server" ControlId="MyDelegateControlTest" Id="MyDelegateControlTest"&gt;
  &lt;template_Controls&gt;
  &lt;script type="text/javascript"&gt;var mvar='hello'; console.log('hello world');&lt;/script&gt;
  &lt;/template_Controls&gt;
  &lt;/SharePoint:DelegateControl&gt;
  </code></pre>
  
  <p>But the minute I try to store a session variable...</p>
  
  <pre><code>&lt;SharePoint:Delegate runat="server" ControlId="MyDelegateControlTest" Id="MyDelegateControlTest"&gt;
  &lt;template_Controls&gt;
  &lt;script type="text/javascript"&gt;var mvar='&lt;%= Session["demo"]%&gt;'; console.log('hello world');&lt;/script&gt;
  &lt;/template_Controls&gt;
  &lt;/SharePoint:DelegateControl&gt;
  </code></pre>
  
  <p>...I get an error on my page that says "Microsoft.SharePoint.WebControls.DelegateControl does not haev a public property names script"</p>
  
  <p>What am I doing wrong?</p>