title: Checking if a user is logged in from site master file
body: <p>When users log in, their sessions are set like so:</p>
  
  <pre><code>HttpContext.Current.Session["LoggedIn"] = true;
  HttpContext.Current.Session["FullName"] = (string)Reader["FirstName"] + " " + (string)Reader["LastName"];
  </code></pre>
  
  <p>My <code>Site.master</code> file contains a navigation menu that's site-wide, and I'd like to change it to show different links depending on if the user is logged in or not.</p>
  
  <p>Something like this in <code>Site.master</code>:</p>
  
  <pre><code>&lt;div id="navigation"&gt;
      &lt;ul&gt;
      &lt;% 
          if (HttpContext.Current.Session["LoggedIn"] != null)
          {
              %&gt;&lt;li&gt;&lt;a href="/user74/aspnet/Logout.aspx"&gt;Log out&lt;/a&gt;&lt;/li&gt;&lt;%
          }
          else
          {
              %&gt;
                  &lt;li&gt;&lt;a href="/user74/aspnet/Register.aspx"&gt;Register&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="/user74/aspnet/Login.aspx"&gt;Log in&lt;/a&gt;&lt;/li&gt;
              &lt;%
          }
      %&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>However, this doesn't seem to work. Looks like you can't use ASP tags like PHP tags.</p>
  
  <p>How can I achieve this?</p>