Cookies not set immediately


I am trying to set a cookie using Vaadin using this code:

VaadinService.getCurrentResponse().addCookie(cookie) whereas the path of the cookie is set to

VaadinService.getCurrentRequest().getContextPath() This seems to work.

Unfortunately in one special case it is not working:

If I set a cookie, and immediately redirect my uis, inside the new ui class instances caused by the session close, still the old cookie value is read.I do this using the following code:

// Set Cookie here like mentioned above

VaadinSession session = VaadinSession.getCurrent();
Collection uis = session.getUIs();
for (UI ui : uis) {
ui.access(() → ui.getPage().setLocation(“”));

[/code]As a push transport mode I am using long polling, because of a bug that prevents the setting of cookies using web sockets.

Does someone have an idea on how I could get the new cookie value inside the uis?

Thank you in advance!

This seems to apply for Firefox (32.0.3) and IE (10.0.9200.17089). It works in Chrome (38.0.2125.104 m).