0

Disable multi-window/multi-tab usage of web applications

asked 2012-05-16 16:59:24 +0800

adisonz gravatar image adisonz
39

how can I limit the application to only allow one single session in one Tab ,

my application current will redirect to after logged in page if user opens a new tab / window.

any suggestion on how to accomplish this ?

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2012-05-30 04:51:22 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

Hi,
I think you can't do it.
Ref:
http://stackoverflow.com/questions/368653/how-to-differ-sessions-in-browser-tabs

why will "opening a new tab" redirect to after-logged-in page?

link publish delete flag offensive edit

answered 2012-05-30 17:33:55 +0800

adisonz gravatar image adisonz
39

this is because the application checks if a session is valid and redirect to after login page.

using Execustions.sendRedirect

i am thinking of using Executions.forward. will this make any changes ?

link publish delete flag offensive edit

answered 2012-07-05 00:57:11 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

no.
redirect is browser's action, and forward is server's action. but they don't create a new session in the same browser.

link publish delete flag offensive edit

answered 2016-07-28 19:29:38 +0800

takach gravatar image takach
30 2

updated 2016-07-28 19:37:53 +0800

Its is generally possible to disable multitab usage of your app, see ex. http://stackoverflow.com/questions/11652861/java-ensure-web-application-open-only-in-one-browser-tab

The solution is simple: setup a random session variable at successfull login, send it in each HTTP Response if it is present in the HTTP Request (or the request was the login request), and deny the Response otherwise. (It makes possible only navigating within your app using your own navigation, but impossible to switch to an other page inside the app using a direct URL.

The only questions is: how to force ZK (on the client side) to send this property with each request.

You can use a simple ServletFilter to check each request on the server side.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-05-16 16:59:24 +0800

Seen: 262 times

Last updated: Jul 28 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More