Search Results for

    Show / Hide Table of Contents

    Class RequestContexts

    Browser request contexts for defining relationship between the browser request contexts of individual renders.

    Important for cookies and user preferences.

    Inheritance
    System.Object
    RequestContexts
    Namespace: IronPdf.Rendering
    Assembly: IronPdf.dll
    Syntax
    public sealed class RequestContexts : Enum

    The RequestContexts enumeration in IronPDF controls how browser state such as cookies and cache is shared across individual renders.

    Part of the IronPdf.Rendering namespace, declared values are Auto, Isolated, and Global (3 total). The value is assigned to ChromePdfRenderOptions.RequestContext so that Isolated renders stay sandboxed, while Global lets sessions persist between calls to RenderHtmlAsPdf or RenderUrlAsPdf.

    See cookies for typical C# usage.

    Fields

    Auto

    Defaults to Isolated

    Uses Global if the user has ever invoked IronPdf.Engines.Chrome.ChromeInterop.UnmanagedDelegates.ApplyCookies

    Declaration
    public const RequestContexts Auto
    Field Value
    Type Description
    RequestContexts

    Global

    Uses the global request context which is shared between all renders

    Declaration
    public const RequestContexts Global
    Field Value
    Type Description
    RequestContexts
    Remarks

    Useful in some cases for persisting certain browser states between renders

    Isolated

    Creates a new request context which will be isolated from previous or future renders

    Declaration
    public const RequestContexts Isolated
    Field Value
    Type Description
    RequestContexts
    Remarks

    Recommended, as this will ensure this render is not affected by previous renders

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget