• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Closing popup windows that have timed out

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am generating a popup window from my application. The application control is such that if the session has timed out, the user is directed to a login page.

If the session has timed out and a popup window is open, clicking on a link takes the user to the login page. I dont want the same to occur as I dont want the user logging in from a popup window etc.

I would rather close out these windows. How can this be accomplished?

Thanks much in advance
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can think of a couple of ways you might accomplish this:

1.Automatically refresh the page every minute or so, and have it check for the existence of a session each time it refreshes. If none exists, close the window.

2.The same as number 1, except that you make an AJAX call to the server checking for a session instead of refreshing the page.

3.I've been hearing about something called COMET, which is like AJAX, except that it will allow Javascript code to respond to an event initiated by the server. I don't know much about it, but I was thinking you could implement an Application event listener on the server that fires when the HttpSession is about to time out, and then have the server throw a COMET event that javascript code in the document receives and then closes the window.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic