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

Support for multiple cookies #236

Closed
leandromsales opened this issue Nov 27, 2015 · 1 comment
Closed

Support for multiple cookies #236

leandromsales opened this issue Nov 27, 2015 · 1 comment

Comments

@leandromsales
Copy link

Hi folks...

In a simple test I was running, the webserver sent the following response header:

Date: Thu, 26 Nov 2015 23:07:42 GMT
Server: Apache/2.4.16 (Unix)
Set-Cookie: CookieTesteName1=CookieTesteValue1; expires=Fri, 27-Nov-2015 00:07:42 GMT; Max-Age=3600; path=/folder; domain=.domain.com; secure
Set-Cookie: CookieTesteName2=CookieTesteValue2; expires=Fri, 27-Nov-2015 00:07:42 GMT; Max-Age=3600; path=/folder; domain=.domain.com; secure
CustomHeaderName: CustomHeaderValue
Content-Length: 2397
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html

Please, note that there is two "Set-Cookie", but response.headers["Set-Cookie"] using cordova-plugin-fetch only returns a string containing the last "Set-Cookie" value. Is this the expected result?

@dgraham
Copy link
Contributor

dgraham commented Nov 27, 2015

See #138 and #163 for a discussion of forbidden headers and cookies.

In the general case, with the exception of forbidden headers, the expected behavior is to append all values for each header to the headers list. For example, if the response includes these headers:

Server: Apache/2.4.16 (Unix)
Server: nginx

then accessing the Server header returns both values:

values = response.headers.getAll('Server')
// => ['Apache/2.4.16 (Unix)', 'nginx']

@dgraham dgraham closed this as completed Nov 27, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants