session timeout: why no redirect to settled logout url

Is there any reason why vaadin doesn’t redirect to the settled logout url after session timeout?


public class VaadintestingApplication extends Application {
	@Override
	public void init() {
		
		System.out.println("init");
		
		setLogoutURL("http://google.com");
		
		Window mainWindow = new Window("Vaadintesting Application");
		
		Button btn = new Button("Logout");
		btn.addListener(new ClickListener() {
			
			public void buttonClick(ClickEvent event) {
				close(); // This one redirects to google.com
			}
		});
		btn.setImmediate(true);

		mainWindow.addComponent(btn);
		setMainWindow(mainWindow);
		
	}

	@Override
	public void close() {

		// After session timeout this method is invoked
		// but vaadin doesn't redirect to google.com

		System.out.println("close");
		setLogoutURL("http://google.com"); // set it again, just to be sure.
		super.close();

	}

}

You need to set CustomSystemMessages to change the SessionExpired URL:


public static CustomizedSystemMessages getSystemMessages(){
	CustomizedSystemMessages msgs = new CustomizedSystemMessages();
        msgs.setSessionExpiredURL("YourURL");
        return msgs;
}

Add this to your main class and it should work.

After a klick on the customized message one get redirected to the defined URL. Anyway this doesn’t happen automatically, there has to be a user action before (interaction with the server)

I guess there’s no way the server redirects the user automatically to a defined URL after session timeout. That would need push notifications, right?

Actually, probably not even push would help as that channel goes down as well when the session expires on the server. Technically, the client side could poll the server and then redirect if it receives a reply indicating that the session has expired.

Use CustomizedSystemMessages.setSessionExpiredNotificationEnabled(false) (in Vaadin 7, Vaadin 6 should have an equivalent) to make the redirection take place as soon as the client finds out the session is expired. Then again, polling (other than the Vaadin 7 heartbeat) will keep the session alive as long as the browser stays open, but might lose the connection if e.g. a laptop goes into sleep mode.

Hi Henri . While using @Push(pushMode = PushMode.MANUAL) on top of the
" public class DiversitysummitadminwebUI extends UI " am getting @Push can not be resolved to a type. I have already changed in web.xml " "

Is there any need to add jar means from where should i get the vaadin 7.0.5 supported jars. and i researched to get vaadin-push.jar also i didn’t get from any version. How can resolve this annotation.

subathra: I think the Push functionality is only available in 7.1.0 and newer (Current version: Vaadin 7.1.0.beta1)
So you have to update your Vaadin version before you can use this feature.

Milestone of 7.1.0.beta1:
http://dev.vaadin.com/milestone/Vaadin%207.1.0.beta1

If you want to wait for the full release of Vaadin 7.1.0 here is the milestone:
http://dev.vaadin.com/milestone/Vaadin%207.1.0

HI Marius . Am using the latest version of vaadin 7.0.5 .

Ok but you have to update to 7.1.0.beta1 because in vaadin 7.0.5 and earlier there is no Push-Functionality without using Add-Ons.

The only way to do it in this version is to use, like I said, an Add-On:
Two of the most popular ones are:
ICEPush
and
DontPush-OzoneLayer