flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schwarz, Robert" <Robert.Schw...@westernasset.com>
Subject RE: Browser close event
Date Mon, 29 Feb 2016 19:35:28 GMT
I use this in my template file, but only works for IE. 

    <body scroll="no">
		<script language="JavaScript" type="text/javascript">
		<!--
		var logoutInProgress = false;
		window.onbeforeunload = confirmPageUnload;
	   	 // -->    
	               </script>	


Alternatively, I setup of a session watchdog on the server side that keeps track of new subscriptions,
drop-offs, logout events, etc.
When the client stops polling for x seconds, I kill their session, and release their resources.

        <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling"
class="my.class.TimedAMFEndpoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-millis>500</polling-interval-millis>
                <piggybacking-enabled>false</piggybacking-enabled>
            </properties>
        </channel-definition>

    public void invalidateClientSession(String uniqueClientId)
    {
        FlexSession flexSession = FlexContext.getFlexSession();
        flexSession.removeAttribute("authUser");
        flexSession.invalidate();
        log.info("Session for " + uniqueClientId + " has been invalidated!");
    }

-----Original Message-----
From: Marcus Fritze [mailto:marcus.fritze@googlemail.com] 
Sent: Monday, February 29, 2016 2:16 AM
To: users@flex.apache.org
Subject: Re: Browser close event

Hi,

you should use ExternalInterface and use a javascript event that kicks in, when the  browser
will be closed

maybe window.onbeforeunload

Marcus

> Am 29.02.2016 um 04:12 schrieb Saju Thankathurai <saju.shela@gmail.com>:
> 
> ​Hi,
> 
> Is there a good way to handle browser close event in Flex? I need to fire a
> remote call to unlock a resource when user closes the browser.
> 
> --
> Saju​


********************************************************************** 
E-mail sent through the Internet is not secure. Western Asset therefore recommends that you
do not send any confidential or sensitive information to us via electronic mail, including
social security numbers, account numbers, or personal identification numbers. Delivery, and
or timely delivery of Internet mail is not guaranteed. Western Asset therefore recommends
that you do not send time sensitive or action-oriented messages to us via electronic mail.
**********************************************************************   
Mime
View raw message