This is a discussion on "Prevent multiple instances of web page" within the JavaScript Forum section. This forum, and the thread "Prevent multiple instances of web page are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Prevent multiple instances of web page
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Prevent multiple instances of web page
I am trying to implement a solution in Javascript that prevents (or more realistically detects) multiple instances of a web application or page and if more than one window exists the latest window(s) redirects the user to a 'Please do not open more than one window for this application' message.
I am thinking about use of cookies to 'monitor' or poll the page, every 'x' seconds - but I am concerned about perceived browser performance (the environment is very restrictive). Better still perhaps I could make use of load and unload events? Does anyone have any ideas or experience of such an odd request? The task is based on a poor performing application (so it's rotten before I start!) and the solution needs to be robust so that in case of browser crashes or similar the user is not locked out or prevented from opening the application again. Thanks for any help - sorry the request is a bit vague! |
|
|
|
||||
|
Re: Prevent multiple instances of web page
Just use sessions with javascript. Update it every 30 seconds with the timestamp. If the person opens another window and the session is valid (hasn't been more than 30 seconds since refresh) don't show the content.
That shouldn't take up much system resources.
__________________
CloudedVision, WebForumz Moderator Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
|
|
|||
|
Re: Prevent multiple instances of web page
Thanks - that pretty much were I was heading (using Cookies rather than sessions) and dabbling with onload and onunload/onbeforeunload events.
Frankly it's a dodgy solution to a rubbish problem - but hey, that's my job! |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can I run multiple Double Combobox scripts on the same page? | RachVG | JavaScript Forum | 0 | May 15th, 2008 09:06 |
| Best way to prevent access to page B except via page A? | Donny Bahama | PHP Forum | 1 | Apr 3rd, 2008 02:15 |
| How do i Multiple AJAX Calls on the Same Page ? | jd2007 | JavaScript Forum | 2 | Aug 9th, 2007 09:59 |
| how to prevent page jumping while click on iframe | kathirnk | Web Page Design | 1 | Apr 16th, 2007 14:05 |
| Help please with multiple audio on page | jwylot | Starting Out | 7 | Mar 12th, 2007 04:01 |