I'm working on an inter-site single-sign-on project and have had a pretty little problem dropped in my lap. When a user logs out of the "parent" site, a particular page needs to be loaded in the popup window containing the "child" site. However, I can't store a reference to the return value of window.open(…)
, because the user must be allowed to navigate wherever they like on each site before logging out.
This would be easy if I could assume that the child site is always open, as another window.open(…)
to the same named window would change its URL. However, the popup cannot be caused to appear if it isn't already open (not all users have access to the child site).
I think this gives me two conflicting scenarios. When the user visits the child site:
- User logs in to parent site.
- User clicks link for child site
- Child site appears in a window named "child_popup".
- User browses far and wide in the parent site, forgetting that the child window exists.
- User logs out of parent site.
- Child popup is redirected to the child site's logout page.
And when the user does not or cannot visit the child site:
- User logs in to parent site.
- User browses far and wide in the parent site.
- User logs out of the parent site.
- No popup should appear!
So my limitations are:
- I cannot store a reference to the window in JS, as the user may navigate to any number of pages between visiting the child site and logging out.
- I have zero control over the contents of the child site (my employer runs the parent site).
- The parent site cannot be converted to frames to provide a "global" JS scope. :-)
I was not able to find any relevant resources on Google or SO. Is there a way to accomplish this?