logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SteamCookieHeaderParser

    Reads the sessionid and steamLoginSecure cookies out of whatever an author pasted from their browser.

    Inheritance
    object
    SteamCookieHeaderParser
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Steam.Infrastructure
    Assembly: Serenity.Steam.Infrastructure.dll
    Syntax
    public static class SteamCookieHeaderParser
    Remarks

    Accepts three shapes on purpose, because "copy the cookie" means something different depending on where an author copied it from: a raw Cookie: request header line, a bare name=value; name2=value2 string (what a browser's cookie inspector shows), or a DevTools "copy as cURL" blob, which carries the header behind a -H 'Cookie: ...' flag or the cookie jar behind --cookie '...'.

    Methods

    TryParse(string, out SteamPartnerCookies)

    Parses pastedText for the partner site's auth cookies.

    Declaration
    public static bool TryParse(string pastedText, out SteamPartnerCookies cookies)
    Parameters
    Type Name Description
    string pastedText

    A raw Cookie: header line, a bare name=value; name2=value2 string, or a DevTools "copy as cURL" blob.

    SteamPartnerCookies cookies

    The cookies found. May be incomplete (missing one of the two) — check IsComplete. Null when nothing that looked like a cookie was found at all.

    Returns
    Type Description
    bool

    Whether any cookie name/value pair was found in pastedText.

    TryParse(string, out SteamPartnerCookies, out string)

    Parses pastedText like TryParse(string, out SteamPartnerCookies), saying why it refused.

    Declaration
    public static bool TryParse(string pastedText, out SteamPartnerCookies cookies, out string rejection)
    Parameters
    Type Name Description
    string pastedText

    The pasted text.

    SteamPartnerCookies cookies

    The cookies found, or null when nothing usable was found.

    string rejection

    ControlCharacterRejection when a cookie value held a control character, otherwise empty.

    Returns
    Type Description
    bool
    In this article
    © 2026 Serenity. All Rights Reserved