This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Avoid User to do Ctrl+N and use the same session

 
Rajesh Savitri
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my application I need to make sure the user is using only one browser.
After logging in to my application and he does a Ctrl+N to open a new window. But since this request also shares the same session he is able to browse my application using two windows. I need to identify when a request comes from a second window and deny service in this window. How do I do this? Can some one help me out in this?
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you could use the "document.referrer" property of the document. If it is the same as the document requested, then you know the request came from the second window. Another property that can give you a clue is "document.history".
With that said, I should point out that this is not a Java question. HTML and JavaScript Forum is a better fit for your query.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll move it accordingly.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not block Ctrl-N and checking the referer is not going to work since if you reload the page it will not work.
Only thing I can say is you are going to have to keep track with sessions with a variable that is time dependent. Check that time when submitted. If it is not the version you are looking for error out.
My 2 cents
Eric
 
Rajesh Savitri
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric,
Can you please explain me a bit more, what eaxctly I need to do...??
 
S Chandra Mohan
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
One way is that you can restrict it through Javascript functions.
The other way is that, u can check that a new screen comes out only when an event in that page occurs (Like, a page can be called only when an url or button in current page is clicked)
But u have to do R&D on this. I think u can get thru.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic