Notifications dissapearing too soon

Do you know how to let the notifications stay for whole duration when switching pages ? I would like to notify user with notification and let that notification persist on switching page by server.


if (validateInput(oldPassword, newPassword1, newPassword2)) {
      Notifications.showSuccessNotification("Heslo uspešne zmenené");
      String email = SecurityUtils.getLoggedInUser();
      User user = userService.getUserByEmail(email);

You can try something like, the 5000 is in millis, i.e. 5 seconds."Heslo uspešne zmenené", 5000, Position.MIDDLE)

Excuse me for my incomplete question.

Internal implementation of Notification in my project looks like this and nevertheless it still disappears sooner than 3000ms.

public static void showSuccessNotification(String text) {
    showNotification(text, NotificationVariant.LUMO_SUCCESS);

   * Method displays a notification inside user's browser window
   * @param text The text of the notification
   * @param variant The variant of the notification
  private static void showNotification(String text, NotificationVariant variant) {
    Notification notification = new Notification(text, 3000);