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

mc should respect "Set-Cookie" headers and provide the Cookie in requests #2610

Closed
eripa opened this issue Nov 21, 2018 · 7 comments
Closed

Comments

@eripa
Copy link

eripa commented Nov 21, 2018

Expected behavior

mc should respect Set-Cookie headers in responses. When using a reverse proxy that uses sticky sessions based on Cookies, mc should provide this cookie back to the proxy for ensure the proxy/load balancer can properly persist the session.

Actual behavior

mc --debug shows that the proxy/loadbalancer sends the Set-Cookie header in the response, but doesn't attach the cookie on the next request.

Steps to reproduce the behavior

  1. Setup a HAProxy (or similar) reverse proxy in front of minio
  2. Enable the proxy to use Sticky sessions by cookie
  3. Make requests with mc --debug to see that the Set-Cookie header is ignored

mc version

 Release-Tag:RELEASE.2018-11-06T01-12-20Z | Commit:b827fac6356f | Host:e1e0a95ab4a1 | 

System information

N/A

@harshavardhana
Copy link
Member

This is not part of S3 standard - mc is an S3 client - can you provide S3 documentation regarding this ? Or any other S3 clients which support this behavior ?

@eripa
Copy link
Author

eripa commented Nov 22, 2018

It might not be part of the S3 standard -- I don't know. But honestly, with that reasoning there's no need to have the mc client at all if it's just intended to 100% mimic the S3 client.

It's common functionality in HTTP servers/clients (https://tools.ietf.org/html/rfc2965) and since S3 wouldn't send any Set-Cookie it wont affect the S3 compatibility.

Feel free to close if you don't think it's a valid feature. Thanks for considering it.

@harshavardhana
Copy link
Member

It might not be part of the S3 standard -- I don't know. But honestly, with that reasoning there's no need to have the mc client at all if it's just intended to 100% mimic the S3 client.

yes, mc only works with S3 servers I don't think it can be used with any other object storage servers. So mc works within the boundaries of S3. Set-Cookie like features are meant for your custom applications, not mc.

@eripa
Copy link
Author

eripa commented Nov 23, 2018

The reason why I suggested is that it's a normal thing for load balancers to do to route traffic to the same instance. E.g. you have HAProxy in front of your minio cluster and then HAProxy injects the cookie to keep clients pinned to one server.

harshavardhana added a commit to harshavardhana/minio-go that referenced this issue Dec 31, 2018
@harshavardhana harshavardhana self-assigned this Dec 31, 2018
@harshavardhana
Copy link
Member

This required a change in minio-go PR already sent minio/minio-go#1054

@eripa
Copy link
Author

eripa commented Jan 2, 2019

Thanks a lot, @harshavardhana! Much appreciated. :)

harshavardhana added a commit to harshavardhana/mc that referenced this issue Jan 2, 2019
harshavardhana added a commit to harshavardhana/mc that referenced this issue Jan 3, 2019
kannappanr pushed a commit that referenced this issue Jan 3, 2019
@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants