Thanks, Darin. There was a slight bug in the code you sent, which is that
Sesion.loggedIn has to be lower case for JavaScript to recognize it as a
Boolean keyword. That's fixed in the version below:
<cfsavecontent variable="headerStuff">
<cfoutput>
<script type="text/javascript">
var isStillValid = #LCase(Session.LoggedIn)#; //
function checkStatus(){
if(!isStillValid && window.opener != null){
window.opener.location.href = 'ReporterLogin.cfm';
window.close();
}
}
checkStatus();
</script>
</cfoutput>
</cfsavecontent>
<cfhtmlhead text="#headerStuff#">
However, that version leads the login window to keep opening and opening and
opening and opening... in an infinite loop, as though it looks back to see if
any of its grandparents were opened in a window! However, with that code in the
login page, if you just open it from the browser's address bar, the same thing
happens. I don't know why.
What does work for me is the following JavaScript code in the login page:
if (opener && opener.location.href.indexOf('PostJob') > -1){
opener.location=window.location;
window.close();
}
It works because the only child window in the whole site is opened from
PostJob.cfm. Too bad it's not a general solution, but it does work.
Thanks,
Peyton
-----Original Message-----
>From: Darin Kohles <[EMAIL PROTECTED]>
>Sent: Mar 10, 2008 3:48 PM
>To: [email protected]
>Subject: Re: [ACFUG Discuss] Rip Van Winkle's Memory Fails
>
>Peyton, try this in the code on the login page :
>
><cfsavecontent variable="headerStuff">
> <cfoutput>
> <script type="text/javascript">
> var isStillValid = #SESSION.loggedIn#; //
>Assuming you have a Boolean var
> function checkStatus(){
> if(!isStillValid && window.opener != null){
> window.opener.location.href =
>'Login.cfm';;
> window.close();
> }
> }
> checkStatus();
> </script>
> </cfoutput>
></cfsavecontent>
><cfhtmlhead text="#headerStuff#">
>
>
>The window.opener property will be set if you have used window.open()
>to create the new window.
>On Sun, Mar 9, 2008 at 9:51 PM, Peyton Todd <[EMAIL PROTECTED]> wrote:
>> If I put it in the Application.cfm page, that doesn't help either...
>>
>>
>>
>> -----Original Message-----
>> >From: Darin Kohles <[EMAIL PROTECTED]>
>> >Sent: Mar 9, 2008 6:07 PM
>> >To: [email protected]
>> >Subject: Re: [ACFUG Discuss] Rip Van Winkle's Memory Fails
>> >
>> ><cfsavecontent variable="headerStuff">
>> > <cfoutput>
>> > <script type="text/javascript">
>> > var isStillValid = #SESSION.loggedIn#; // Assuming
>> you have a Boolean var
>> > function checkStatus(){
>> > if(!isStillValid){
>> > window.close();
>> > }
>> > }
>> > checkStatus();
>> > </script>
>> > </cfoutput>
>> ></cfsavecontent>
>> ><cfhtmlhead text="#headerStuff#">
>> >
>> >
>> >-------------------------------------------------------------
>> >Annual Sponsor FigLeaf Software - http://www.figleaf.com
>> >
>> >To unsubscribe from this list, manage your profile @
>> >http://www.acfug.org?fa=login.edituserform
>> >
>> >For more info, see http://www.acfug.org/mailinglists
>> >Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>> >List hosted by http://www.fusionlink.com
>> >-------------------------------------------------------------
>> >
>> >
>> >
>>
>>
>>
>> -------------------------------------------------------------
>> Annual Sponsor FigLeaf Software - http://www.figleaf.com
>>
>> To unsubscribe from this list, manage your profile @
>> http://www.acfug.org?fa=login.edituserform
>>
>> For more info, see http://www.acfug.org/mailinglists
>> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>> List hosted by http://www.fusionlink.com
>> -------------------------------------------------------------
>>
>>
>>
>>
>
>
>
>--
>Darin Kohles
>RIA Application Developer
>
>
>-------------------------------------------------------------
>Annual Sponsor FigLeaf Software - http://www.figleaf.com
>
>To unsubscribe from this list, manage your profile @
>http://www.acfug.org?fa=login.edituserform
>
>For more info, see http://www.acfug.org/mailinglists
>Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>List hosted by http://www.fusionlink.com
>-------------------------------------------------------------
>
>
>
-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------