On the face of it, I don't think it's possible to distinguish between
a refresh and a close--in both cases the browser destroys the current
page (a refresh is just a destroy followed by a build).
You could maybe fake it with a timeout on the server:
- in the browser's onClose(), tell the server "I'm going away"
- in your module's onModuleLoad(), tell the server "I've just started"
If you store a unique token in a cookie and pass that token in both
the "I'm going away" and the "I've just started" messages, the server
could match the two messages together. If an "I've just started"
message arrives shortly an "I'm going away" message, the server could
interpret that as a refresh and not kill the session.
In other words, from the server's perspective:
- receive "I'm going away" from unique token FOO
- set timeout of 30 (?) seconds
- if you receive "I've just started" from unique token FOO before
the timeout expires, cancel the timeout
- if the timeout expires, kill the session
You'd have to set the length of the timeout to suit your situation.
Ian
On 8/19/08, Diyko <Diyk...@gmail.com> wrote:
>
> Thx for ideas
> >
>
--
Fred Sauer
fr...@allen-sauer.com