Results 1 to 6 of 6
Thread: Question about browser sessions
- 06-03-2011, 06:28 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 85
- Rep Power
- 0
Question about browser sessions
In a java web app, if I am browsing a site and then I open another IE 8 window* and go to the same site, is there a way to detect that the request has come from another window from the same machine.
Basically my requirement is to alert the user that they cannot open another window with the same site.
*In IE 8 all windows share the same session. Hence request.getsession() would always return the same ID across all the windows.
- 06-03-2011, 07:10 PM #2
it depends of your application. How you managed to sessions inside.
Skype: petrarsentev
http://TrackStudio.com
- 06-03-2011, 07:26 PM #3
You could include some random and otherwise meaningless ID in the URL and pass it around from page to page. If you see two different IDs associated with the same session, you'll know there are (or were) two different windows opened. Then you could, say, display an error in response to subsequent page loads using the old ID.
Get in the habit of using standard Java naming conventions!
- 06-03-2011, 09:15 PM #4
Member
- Join Date
- Sep 2008
- Posts
- 85
- Rep Power
- 0
@knkrum - can you pls tell me how to append a number to an URL or refer me to some site. I am basically using struts 1.3 application
- 06-03-2011, 09:52 PM #5
Sorry, it's been a long time since I did any Web development. But I would probably add parameters to my URLs using PHP, not Java.
If by Web app you mean an Applet, you can try using Applet.getDocumentBase() to get the URL. But I'm not sure if that will include the parameters.Get in the habit of using standard Java naming conventions!
- 06-03-2011, 10:35 PM #6
Similar Threads
-
sessions
By murali23krishna in forum New To JavaReplies: 1Last Post: 05-17-2011, 11:56 AM -
Sessions
By Billywizz in forum New To JavaReplies: 1Last Post: 03-28-2011, 08:53 PM -
Sessions in jsp
By Ed in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 07-02-2007, 03:46 PM -
sessions in jsp
By Heather in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 06-30-2007, 03:44 PM -
Sessions and logout question
By orchid in forum Web FrameworksReplies: 1Last Post: 05-18-2007, 06:24 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks