You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to extend this to header based session management as cookies have some assumed default behaviour with browsers and not work well with tabs.
The proposal is to add header based stateful session support in the following ways.
Similar to cookie, Envoy can generate the header and encode the host ip:port where caller is expected to pass it on every request. This works similar to cookies except that it is not a special header and hence no default behaviour assumed.
Implement an in memory cache (backed by external cache like redis) that Envoy can lookup.
#2 needs more thought on what key should be used and how to provide integration with external cache etc. But #1 is simpler to implement and people who are willing to build client side solution to keep track of the header and pass on every request can benefit from this (This is actually our main use case as we have client specific code that can send the header on every request).
#1 is easy to implemented and useful for some cases. But is there a standard way to notify the client to send a special header like set-cookie?
Or there will be two configurable header names (one name will be used by the envoy to set response header at first request, one name will be used in the requests) ?
But is there a standard way to notify the client to send a special header like set-cookie?
I am not aware of any
or there will be two configurable header names (one name will be used by the envoy to set response header at first request, one name will be used in the requests) ?
I was thinking one header where envoy will set if it is not present and client will use the same header name in subsequent requests. Would it complicate things?
I was thinking one header where envoy will set if it is not present and client will use the same header name in subsequent requests. Would it complicate things?
IMO, I think a pair of headers would be more clear.
But the key point is if there is no way to notify the client, then only some custom clients that aware the configured special headers can get helps from this header based session. Then may be we shouldn't add it to the core envoy but just keep it as a private extension for yourself?
But the key point is if there is no way to notify the client, then only some custom clients that aware the configured special headers can get helps from this header based session.
I think as long as the header name (pair of headers as you described) are configurable, I think it is generic enough. It is exactly similar to cookie, but the header names change.
I think as long as the header name (pair of headers as you described) are configurable, I think it is generic enough. It is exactly similar to cookie, but the header names change.
May be as you said, it's does helpful for some users.
Activity
ramaraochavali commentedon Aug 1, 2022
discussed offline with @wbpcode and he is generally OK with this.
alyssawilk commentedon Aug 1, 2022
cc @cpakulski as the other co-owner
wbpcode commentedon Aug 2, 2022
#1 is easy to implemented and useful for some cases. But is there a standard way to notify the client to send a special header like
set-cookie?Or there will be two configurable header names (one name will be used by the envoy to set response header at first request, one name will be used in the requests) ?
ramaraochavali commentedon Aug 2, 2022
I am not aware of any
I was thinking one header where envoy will set if it is not present and client will use the same header name in subsequent requests. Would it complicate things?
wbpcode commentedon Aug 2, 2022
IMO, I think a pair of headers would be more clear.
But the key point is if there is no way to notify the client, then only some custom clients that aware the configured special headers can get helps from this header based session. Then may be we shouldn't add it to the core envoy but just keep it as a private extension for yourself?
cc @alyssawilk @cpakulski
ramaraochavali commentedon Aug 2, 2022
I think as long as the header name (pair of headers as you described) are configurable, I think it is generic enough. It is exactly similar to cookie, but the header names change.
wbpcode commentedon Aug 2, 2022
May be as you said, it's does helpful for some users.
ramaraochavali commentedon Aug 29, 2022
@wbpcode Can you please assign this to @Pawan-Bishnoi ?
wbpcode commentedon Aug 29, 2022
/assign @Pawan-Bishnoi
repokitteh-read-only commentedon Aug 29, 2022
@Pawan-Bishnoi cannot be assigned to this issue.
🐱
Caused by: a #22475 (comment) was created by @wbpcode.
see: more, trace.
wbpcode commentedon Aug 29, 2022
Sorry, seems that @Pawan-Bishnoi is not member of this org. So i cannot assign this issue to him.
ramaraochavali commentedon Aug 29, 2022
Ah. I remember. Only few people can add members to the org. @mattklein123 Can you please add @Pawan-Bishnoi to the org and assign this issue?
Pawan-Bishnoi commentedon Aug 30, 2022
@mattklein123 I want to work on this. Please assign this to me.
Thank you! 😄
cpakulski commentedon Sep 7, 2022
I think that
stateful_sessionfilter could be easily extended for this use case.If I understood the idea correctly, the difference comparing to the current
stateful_sessionis to automatically generate a new name instead of using a hardcoded one coming from the config (https://www.envoyproxy.io/docs/envoy/latest/api-v3/type/http/v3/cookie.proto#envoy-v3-api-msg-type-http-v3-cookie) for each new connection and pass it back to the client via response headers.Pawan-Bishnoi commentedon Sep 8, 2022
@cpakulski The header name should come from config (similar to cookie name). For example: