Embeded vaadin application and sessions

Hello,

I have a large website which can not be updated all at once due to the quantity of work to put into it.
We decided to add a new feature in the form of a vaadin application to make it feel more modern.

I have the application working as a standalone, I also did embed it into a div using the javascript of the embeding demo.
All of this is working well until user changes.
I want to be able to have the user log in into the main website and share the loggin information with vaadin in some way so that each user is running a different application.

I made my application implementing HttpServletRequestListener and get the session from from the request in onRequestStart.
When I do a request.getSession().getAttribute(“foo”) in the application, it returns null even if the website has set it just before so it seems like the session is not shared.

Looking at the forum I saw somebody using hidden fields and some javascript to share data across the boundary but it is quite an ugly way to go around.
What is the best way to implement this ? Any idea ?

Thank you.

I am running both the old website and vaadin in the same tomcat v6.0.26, Vaadin is version 6.5.6.

Hello,
The session from your site and the session of the vaadin application are two different sessions and cannot share information. So the only way would be to somehow give the credentials (encrypted or not) to the vaadin application i.e. via an HTTP POST when the login takes place in your site. For this you can either use a HttpServletRequestListener , however you’ll have to take care of the timing i.e. when the authentication in your vaadin takes place and when you want the vaadin application to react, you could use your own servlet extending the vvadin servlet or you can use UriHandler and ParameterHandler.

Thank you for the quick answer, this was easy to set up.
I didn’t think about that at all. I guess I was looking for much more complicated ways !