Leon Rosenberg on 31/08/05 13:17, wrote:
On Wed, 2005-08-31 at 12:46 +0100, Adam Hardy wrote
Emmanouil Batsis on 31/08/05 12:37, wrote
Sławek Tuleja wrote:
question: but how to evoke Logoff action when user closes browser?
In general you dont :-) You just wait for the session to expire using
a session event listener. However, if the client supports javascript,
you can catch the onclose event and perhaps submit an XMLHTTPRequest
to the server (if the object is supported), but you cannot actually
rely on this.
If you're mad keen on the idea and wish to avoid javascript, put an
invisible iframe in the page with a
<meta http-equiv="Refresh" content="15; URL=../action/redirect.html"/>
in the header, so that the client's browser continually polls the
server, and set a listener to do something when it stops. I would never
do that myself though ;)
why not?
Firstly it could easily be considered as sneaky by the general surfing
public because it would be on the user's browser doing its stuff yet
because it was invisible / hidden, the user would be completely unaware
of it.
Secondly every now and again it would cause the browser's loading
activity icon to signal activity, which could be confusing.
Thirdly iframes are not supported by all browsers.
Fourthly I think the work involved in making something track all
sessions like this and then inactivate any that stop would be
considerable. At least I can't think of a suitable algorithm off the top
of my head.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]