In Vaadin 8 , we could handle Cookies via VaadinService, is there already some equivalent in Vaadin flow?
Greetings
In Vaadin 8 , we could handle Cookies via VaadinService, is there already some equivalent in Vaadin flow?
Greetings
Hi Sebastian
You can still do something like this:
HttpServletRequest request =
(HttpServletRequest) VaadinRequest.getCurrent();
Cookie[] cookies = request.getCookies();
to access cookies sent by the browser.
And
HttpServletResponse response = (HttpServletResponse) VaadinResponse.getCurrent();
Cookie cookie = new Cookie("name", "value";
response.addCookie(cookie);
to send new cookies. Just don’t use this code from background threads.