That is a stupid question. Your application architecture has nothing to do
with the fact that the server-side solution that I have suggested has
nothing to do with the client-side solution that you have suggested.
Now your'e just being daft
Again, seriously. You suggest using "eg. an Image instance, a frame or
iframe or XHR" in the current document in the onunload event to notify
the server that the session should be terminated? Now we can talk
about race conditions...
And how are you going to detect whether the user is leaving the site,
navigating to a different page on the site, closing the window, or
just refreshing??
I'm looking forward to your follow up..
It is not necessary to know the application for this statement to be true..
Then, by that argument, no Programs should ever by run, as they
consume resources, and definitely not in browsers.
It is not silly, it is a fact. And if you knew a first thing about the
Web, you would know this.
Again, your'e generalizing.
And by the way, congrats on discovering the fact that opening a new
window consumes resources. A discovery like that will likely
revolutionize the 'Web'.
Yes, it is.
Use e.g. an Image instance, a frame or iframe or XHR. The odds are better
that any of this works because it does not require the creation of a new
viewport beforehand, especially not a popup window.
So you actually suggest opening a HTML document created to be used as
a user interface with an Image tag? Or via XHR?
If you knew a first thing about the Web, you would know this cannot be
done.
When it may be either too early or too late. You are either assuming that
the browsers must wait for the popup to be fully loaded before navigating
away, or that the browser must navigate away first and then open the popup.
Both assumptions are wrong.
Again, its you that are making assumptions, way to many assumptions.
If you even knew what this was about you would see that it can never
be to late, only to early (the opener not having started the
navigation).
All other scenarios constitutes a failure (window closed, SOP in
effect)
hence the delay. And quite frankly, I don't care why it fails as long
as it is. It serves my purpose (which you are assuming a lot about).
"Ample time"? You know *nothing* about the user's environment, their
connection properties, and the response time of the server hosting the
other Web site that is navigated to.
If you knew what you were talking about you would know that the server
hosting the other web site has nothing to do with it, and the test
would fail due to the SOP (as designed) anyway.
And just to be clear; for all you know its the location property I'm
testing, not the document it self. This would be affected by the SOP
from the first moment the document was navigated.
It is not nonsense, it is a fact that you cannot reliably determine that
way if and when the user has navigated away from the Web site.
Wait a minute, didn't you just give me some brilliant solution using
an Image and whatnot?
Wishful thinking.
You are ignoring the distinct possibility that accessing the property can
fail for another reason, in which case you would still "perform an action"
(or so you can hope, assuming try-catch support and a catchable exception),
much to the user's disadvantage.
Yes, I'm ignoring the fact that it can fail due to the neighbors 4x4
crashing through the wall and severing the power to the computer.