Hi Cosmin,
What have you tried? 
Sending 1. .../frame_page;jsessionid=123 or 2.
.../frame_page?jsessionid=123.
The first option may work while the second it's normal not to have any
impact on the session but can be used to get the sessionid as a parameter.

The 1. option if it works, is not really fullproof, as from my experience if
the user already has a JSESSIONID cookie, the value in the cookie takes
precedence so the user will come in the frame page with an old sessionid,
but it's simplest.

And since you say that we cannot set cookies for the frame, I'm thinking the
solution is to set the sessionid cookie "manually" by adding it to the
response from the frame. Since this first request will not have a session
created, we need to force the browser to reload the page/redirect to another
page after we set the session cookie, and the new request will have the
required session with it:

So I'm saying in your frame page page you do something like

FramePage extends WebPage {
...
                                
getRequestCycle().scheduleRequestHandlerAfterCurrent(new
RedirectRequestHandler("/page_to_redirect_after_set_session") {
                    @Override
                    public void respond(IRequestCycle requestCycle) {
                        
                        WebResponse response =
(WebResponse)requestCycle.getResponse();
                        String sessionId =
getRequest().getQueryParameters().getParameterValue("sessionId").toString();
                        Cookie cookie = new Cookie("JSESSIONID", sessionId);
                        cookie.setMaxAge(-1);
                        
                        response.addCookie(cookie);
                        super.respond(requestCycle);
                    }
                });
}

Take care that if you decide on throwing RestartResponseException instead it
does a restart of the old response so your addCookie command will be lost.

Firebug is a great tool that helps you in this, as you will need to look on
the response for Set-Cookie with JSESSIONID response from the frame page.


PS: Yes, I'm from Romania.

-----
http://balamaci.wordpress.com 
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Is-it-possible-to-set-the-session-tp4281720p4285390.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to