Ok, I went with the no-cookies-but-jsession-id-in-url approach and it 
works just fine.

Here's a link to a site that helped me with the Jetty configuration:

http://www.mojavelinux.com/blog/archives/2006/11/disabling_session_cookies_in_jetty/

or - somewhat ugly - in the code:

WebAppContext webAppContext = new WebAppContext();
...
((HashSessionManager) 
(webAppContext.getSessionHandler().getSessionManager())).setUsingCookies(false);

But there is one pitfall: When you switch to not using cookies for the 
session id and a browser still HAS a session cookie, that session cookie 
is - of course - sent as part of the request when you access the 
webapplication again. That causes Wicket to show the session timeout 
page with everything you do (because that session is invalid and the 
cookie is never updated...). So what I did is to set the session cookie 
name to something different than the default "JSESSIONID". That doesn't 
keep the browser from still sending the old session cookie as part of 
the request, but Jetty ignores it because it doesn't have the name Jetty 
is looking for.

In code the workaround looks like this:

((HashSessionManager) 
(webAppContext.getSessionHandler().getSessionManager())).setSessionCookie("SOMETHING_OTHER_THAN_JSESSIONID");

Now I can have multiple different sessions in the same browser. Works 
like a charm!

Thank you guys for your help.

- Johannes
    

Matej Knopp wrote:
> Erik van Oosten wrote:
>   
>> Short answer: NO.
>>
>> Long answer: mostly no, but it strongly depends on the browser.
>>
>> Solution: do not use the session (is against Wicket matra anyway) but 
>> maintain state in the Wicket components. Make sure that your components 
>> are versioned (defaults to on).
>>
>>     
> Yeah, but this is not a solution always (if you have to for example 
> allow two different users to be logged in for some reason). Only thing 
> I can think of that could work is to disable session cookies (if the 
> container allows it) and use jsessionid in url only. This way you can 
> have different session in every browser window.
>
> -Matej
>   
>> Regards,
>>      Erik.
>>
>>
>> Johannes Fahrenkrug wrote:
>>     
>>> Is it possible to have multiple sessions from the same client?
>>>   
>>>       
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>   


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to