Embedding in iframe under Firefox doesn't work as expected.

Hi,

In the Vaadin book
here
it describes embedding a vaadin app in an iframe.


<iframe src ="http://demo.vaadin.com/Calc/" width="100%" height="600">

When trying this with firefox the app loads in the frame, but interacting with the gui seems to instantly kill the session, raising the big red notification “Session Expired.”

The exception being thrown when this occurs says…


Aug 12, 2009 2:52:51 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Myproject Application threw exception
java.lang.IllegalStateException: Cannot create a session after the response has been committed
	at org.apache.catalina.connector.Request.doGetSession(Request.java:2313)
       ....

Oddly, embedding in an iframe with SeaMonkey works as it should and I can interact with the gui without any trouble. I have not yet tried other browsers.

Any ideas what is causing this or how to fix it?

Thanks.

I just discovered that if I check “accept third-party cookies” in Firefox’s privacy options it works as it should.

I do not suppose there is any way I can work around this with Vaadin?

I was about to answer “no”, but actually the error you are receiving suggests that this might be some kind of timing issue (stuff loaded in wrong order). I don’t quite understand what the cookies has to do with this, but maybe if the security cookie is missing the process differs somehow. Anyone else experienced this?

Anyway, I hope that there is a workaround for this. This is quite typical way of running applications.

“Session expired” in this case probably means “Session not found”. If you have cookies turned off (third party if you are including the Vaadin application in the iframe from a different url), it will not be able to find your session and will assume it has expired.