-
Notifications
You must be signed in to change notification settings - Fork 270
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
Add session-cookie-keywords #601
Conversation
Add option to configure the cookie options in more detail. This might be necessary to let the backend server access the affinity cookie or to turn off the `httponly` flag. The default value is still `indirect nocache httponly` to be backwards compatible.
Closes #566 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for supporting this controller! The approach is great, following just a few remarks in the docs.
@@ -198,6 +198,7 @@ The table below describes all supported configuration keys. | |||
| [`session-cookie-name`](#affinity) | cookie name | Backend | | | |||
| [`session-cookie-shared`](#affinity) | [true\|false] | Backend | `false` | | |||
| [`session-cookie-strategy`](#affinity) | [insert\|prefix\|rewrite] | Backend | | | |||
| [`session-cookie-keywords`](#affinity) | cookie options | Backend | `indirect nocache httponly` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sort alphabetically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| `session-cookie-name` | `Backend` | `INGRESSCOOKIE` | | | ||
| `session-cookie-shared` | `Backend` | `false` | v0.8 | | ||
| `session-cookie-strategy` | `Backend` | `insert` | | | ||
| `session-cookie-keywords` | `Backend` | `indirect nocache httponly` | v0.11 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sort alphabetically as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -353,6 +355,7 @@ Configure if HAProxy should maintain client requests to the same backend server. | |||
* `session-cookie-strategy`: the cookie strategy to use (insert, rewrite, prefix). `insert` is the default value if not declared. | |||
* `session-cookie-shared`: defines if the persistence cookie should be shared between all domains that uses this backend. Defaults to `false`. If `true` the `Set-Cookie` response will declare all the domains that shares this backend, indicating to the HTTP agent that all of them should use the same backend server. | |||
* `session-cookie-dynamic`: indicates whether or not dynamic cookie value will be used. With the default of `true`, a cookie value will be generated by HAProxy using a hash of the server IP address, TCP port, and dynamic cookie secret key. When `false`, the server name will be used as the cookie name. Note that setting this to `false` will have no impact if [use-resolver](#dns-resolvers) is set. | |||
* `session-cookie-keywords`: options to the `cookie` option like `nocache`, `preserve`, `httponly`. `indirect nocache httponly` is the default if not declared to be backwards compatible to earlier versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a reference to the default value only if insert
strategy is used.
try also to rephrase the last sentence to something like "the default is ..." in order to separate the former list of keywords to the later one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -110,6 +110,7 @@ const ( | |||
BackSessionCookieName = "session-cookie-name" | |||
BackSessionCookieShared = "session-cookie-shared" | |||
BackSessionCookieStrategy = "session-cookie-strategy" | |||
BackSessionCookieKeywords = "session-cookie-keywords" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sort alphabetically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Merging, thanks! |
Add option to configure the cookie options in more detail.
This might be necessary to let the backend server access the affinity cookie
or to turn off the
httponly
flag.The default value is still
indirect nocache httponly
to be backwardscompatible.