-
Notifications
You must be signed in to change notification settings - Fork 31
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
Make cookie domain configurable for container #94
Comments
@dapperdrop and I just caught up to review the cookie enhancements properly. Would you guys have any thoughts to share @awoehrl and @allmywant ? Here's a brief rundown of what we're thinking: Current stateWe set two cookies from the library for user salt and recording assignment:
We have some undocumented settings for the name prefix, domain and expiry - but we're missing some important new cookies for cross-site/secure usage:
The original undocumented API was setup a long time ago when there were fewer options we had to support:
Proposed state, requirements & key questions
Example proposed APIWe could simply accept an object with settings specified. Mojito.options.cookie = {
domain: '.foo.bar',
path: '/',
secure: true,
sameSite: 'Lax'
}; Maybe we need to have settings specified for the user salt cookie (because that may have different expiry/naming conventions). |
@kingo55 @dapperdrop
Same API can be used for the user salt cookie.
I think we can write a set of tests write cookies with the proposed option(s) then read and check it. |
Yes, that's a good idea... I like that. Is it better to represent the cookie expiry in days or seconds?
Agreed. We haven't had any issues with the current library, so this isn't a big priority.
I wonder whether we can test the cookieDomain/secure in a way that works inside the environments we run tests within (GitHub Actions / Mocha). Most of the other cookie settings should be pretty easy to test for though (path/same site etc). |
I think days is better.
Ahh this is the problem, it seems we have to tests online, e.g. mintmetrics.io |
Cool - yeah, days is much more practical. I thought the testing environment would be an issue here. Maybe we'd only have to build out the unit tests that we can and manually test anything we can't. Looks like |
For cookies like the Mojito User ID and test assignment, we should allow users to specify the domain and/or behaviour of the cookies (e.g. properties).
It might even be worth updating the cookie library we use too.
The text was updated successfully, but these errors were encountered: