Skip to content

How does one use Cookies #75

Answered by jchristn
MeapVR asked this question in Q&A
Oct 30, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi @MeapVR thank you for your kind words, it is much appreciated.

I was able to do this using the Test.Server and Test.Client projects:

Specifically in the client, within InitializeClient:

// before any .Start method
_Client.AddCookie(new System.Net.Cookie("foo", "bar", "/", "localhost"));

And within the server ClientConnected:

if (args.HttpRequest.Cookies != null && args.HttpRequest.Cookies.Count > 0)
{
    foreach (Cookie cookie in args.HttpRequest.Cookies)
    {
        Console.WriteLine(cookie.Name + ": " + cookie.Value);
    }
}

Is that what you're attempting to do?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@MeapVR
Comment options

@jchristn
Comment options

Answer selected by MeapVR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants