SelectPdf Free Html To Pdf Converter for .NET C# / ASP.NET - Helper Page - View HTTP Cookies

This page shows the HTTP Cookies sent to it:

Sample code · C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SelectPdf.Samples
{
    public partial class view_http_cookies : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // Only ever fetched by the SelectPdf converter; flatten the screen-only
            // sticky nav / scrollable rail so the PDF paginates cleanly.
            ((Samples)Master).FlattenForPdf = true;

            string cookies = string.Empty;
            foreach (string key in Request.Cookies)
            {
                HttpCookie cookie = Request.Cookies[key];
                cookies += "<br/>" + cookie.Name + ": " + cookie.Value;
            }

            LitCookies.Text = cookies;
        }
    }
}