title: Cannot properly read a cookie
body: <p>I have a cookie bar that install a cookie called "CookiePolicy" to store user preferences (value = 1 states for OK, of course).</p>
  
  <p>I need to use this value to activate/deactivate Google Analytics from my site.
  I thought it was easy... but it's a real mess! :(</p>
  
  <p>My code</p>
  
  <pre><code>&lt;script runat="server"&gt;
  protected void Page_Load(object sender, EventArgs e)   {
     HttpCookie cookie = Request.Cookies.Get("CookiePolicy");
  
     if( cookie.Value != "1" ){ 
        Response.Write("&lt;script&gt;");
        Response.Write("function (i, s, o, g, r, a, m) {");
        Response.Write("i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {");
        Response.Write("(i[r].q = i[r].q || []).push(arguments)");
        Response.Write("}, i[r].l = 1 * new Date(); a = s.createElement(o),");
        Response.Write("m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)");
        Response.Write("})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');");
        Response.Write("ga('create', 'UA-xxxxx-x', 'auto');");
        Response.Write("ga('send', 'pageview');");
  
    }
  } 
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I receive all kind of errors. What's wrong??</p>
  
  <p>The worst of them...
  <em>System.NullReferenceException: Object reference not set to an instance of an object.</em>  (issued by the if clause)</p>