[
https://issues.apache.org/jira/browse/WICKET-6358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15995740#comment-15995740
]
Martin Grigorov commented on WICKET-6358:
-----------------------------------------
Here is an idea how it may work:
- Wicket's Session is just an attribute in the Servlet HttpSession
- by using org.apache.wicket.ajax.AjaxNewWindowNotifyingBehavior you can assign
different window.name to each tab
- you can use this unique window.name to store/load the current tab's Wicket
Session to/from the http session. See
org.apache.wicket.session.HttpSessionStore#bind() and
org.apache.wicket.session.HttpSessionStore#lookup(). By default those methods
use org.apache.wicket.Session#SESSION_ATTRIBUTE_NAME as an attribute name. You
could use SESSION_ATTRIBUTE_NAME + ":" + windowName, for example.
So you need custom ISessionStore and IComponentInstantiationListener that adds
AjaxNewWindowNotifyingBehavior to all your pages.
> Possibility for each browser tab to have independent wicket session
> -------------------------------------------------------------------
>
> Key: WICKET-6358
> URL: https://issues.apache.org/jira/browse/WICKET-6358
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 8.0.0-M5
> Reporter: Martin Makundi
>
> Here are a couple of discussions on the topic:
> https://myfaces.apache.org/orchestra/myfaces-orchestra-core/multiwindow.html
> http://stackoverflow.com/questions/368653/how-to-differ-sessions-in-browser-tabs
> http://stackoverflow.com/questions/4970004/support-multiple-browser-tab-session-j2ee-web-application
> Currently in wicket if user wants to safely use two browser windows in the
> same application, they must login from different browsers (or use some
> suitable browser-specific private browsing mode).
> We would like to add functionality into wicket to allow:
> - automatic detection of new browser tab
> - configuration option which would keep independent wicketsession for each
> browser tab (initially clone from wicketsession of window that opened new tab)
> - possible solution: pagemap and wicketsession could go hand in hand, each
> pagemap with its own wicketsession to keep them insulated
> We'll start working on this immediately, all suggestions welcome.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)