Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookie is invalid #520

Closed
ghost opened this issue May 21, 2020 · 7 comments
Closed

Cookie is invalid #520

ghost opened this issue May 21, 2020 · 7 comments
Labels

Comments

@ghost
Copy link

ghost commented May 21, 2020

image

I passed the cookie value into the request header, but when I executed the "POST" method, I received an error as shown below. This error occurs when I pass an object of type Dictionary <string, string>

var cookies = new Dictionary <string, string>
{
    {"JSESSIONID", "0677235D8C9FB757B79550F7E42AE7C4.passport1686"},
    {"BIGipServerPASSPORT_12", "279441418.60961.0000"},
}

var response = await _flurlClient.Request().WithCookies(cookies).PostUrlEncodedAsync(ct).ConfigureAwait(false);

image

@ghost ghost added the bug label May 21, 2020
@tmenier
Copy link
Owner

tmenier commented May 26, 2020

I can't reproduce this. What platform are you on?

@ghost
Copy link
Author

ghost commented May 26, 2020

.NET Core 3.1, wpf

@tmenier
Copy link
Owner

tmenier commented May 26, 2020

Ah, looking closer at that error message there appears to be a space at the beginning of the cookie name. That's the direct cause of the error. Flurl would not have added that space. Are you hard-coding the cookie name "BIGipServerPASSPORT_12" exactly as in your example or is it possible you're reading it in from somewhere and might have a leading space?

@ghost
Copy link
Author

ghost commented May 26, 2020

If I pass a cookie value as a string then this does not happen
"JSESSIONID=0677235D8C9FB757B79550F7E42AE7C4.passport1686, BIGipServerPASSPORT_12=279441418.60961.0000"

@tmenier
Copy link
Owner

tmenier commented May 26, 2020

Um...I'm not sure if that answers the question. Let's try this: can you write an isolated unit test that reproduces this issue?

@tmenier
Copy link
Owner

tmenier commented Aug 8, 2020

Let me know if the latest prerelease resolves this.

https://www.nuget.org/packages/Flurl.Http/3.0.0-pre4

@tmenier
Copy link
Owner

tmenier commented Sep 1, 2020

Feel free to re-open if the latest prerelease doesn't resolve this.

@tmenier tmenier closed this as completed Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant