-
Couldn't load subscription status.
- Fork 15
Description
Avaje Jex has Context.Cookie which has a few methods like expires(ZonedDateTime), secure(boolean) etc. Javalin, etc has similar.
If io.avaje.http.api had something like this as an API for setting cookies, which you can accept in a method as such:
@Controller
...
@Post
void test(Cookies cookies) {
cookies.set("example", "value");
cookies.set("example2", "value", Duration.ofDays(7));
}
...then we can abstract this feature away and it would be the same for all generators, one less reason to inject Context, and makes the controllers slightly more portable between the underlying routing implementations.
I don't know if that is a goal or if this is within the scope of this project.
Using Context, whether with constructor or method argument injection, pretty much works exactly the same way.