New browser tab redirecting to login page

  1. We have an application running fine on vaadin 6.
  2. Now we are migrating the entire application to vaadin 7.
  3. We have a login page (http://localhost:8080/application)
  4. After login we have so many menus and user click on one of the menu to load that page(component)
  5. Then the user takes a new tab in the same browser with url http://localhost:8080/application
  6. Now he is redirecting to the login page
  7. In vaadin 6 , it will load the same page of the previous tab
  8. I have given @PreserveOnRefresh but it is solving the refresh problem only

How i can achieve the same

Hi,

When user opens the UI in new tab, new UI instance will be created. So they does not share the same state. Anyway the two UI instances share the same VaadinSession so you could use that. Save the login information to the session. When you init() the UI, check if the user is already logged in. If not redirect to login page, otherwise show your application. There is an example about this in wiki:
https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20simple%20login%20view