Disable session interval on runtime

Hello guys,
in my application i have setted a session that is going to close on 60 seconds of inactivity.
In some parts of my application i have to disable this kind of behavior and i have thought to use this code :

VaadinSession.getCurrent().getSession().setMaxInactiveInterval(-1);

But at the moment, on Vaadin 8, it seems not working…do you have any idea?
Matteo