[whatwg] When closing the browser
Bil Corry
bil at corry.biz
Tue Apr 28 07:36:15 PDT 2009
Ian Hickson wrote on 4/27/2009 1:24 PM:
> One option would be to have an attribute, say <body logout="">, which
> causes the user agent to ping the site when the window is closed and there
> are no other windows open to the same origin.
>
> Of course this would break if the other window in question was open to a
> different page that didn't have the logout="" attribute..
>
> Maybe it should be invoked if there are no other pages open that have the
> same logout="" attribute?
>
> This has the advantage of not depending on JavaScript, and not affecting
> the browser's performance (no waiting for sync XHR, etc).
>
> It would work somewhat like PING does today, though probably using POST.
I like the idea -- thinking out loud here, rather than invoking it when all pages having the same logout="" attribute are closed, can it instead use some other grouping identifier? That would allow a developer to pass back unique information from each page via the URI. And I like POST instead of GET. A same-origin restriction would be good too. Would the browser accept a response from the logout? I'm thinking that could be used to immediate end the cookie(s).
- Bil
More information about the whatwg
mailing list