S
Sean Kinsey
On Apr 8, 8:58 am, Sean Kinsey wrote:
> [...]
>
> It has already been discussed and this is still not
> possible to use. It can, and is, used to persist the
> session, but cannot be used to notify the server about
> a navigation due to the code not knowing if the
> navigation is a safe refresh or not.
>
> To propose the only way it _could_ work:
> * In a pre-unload event, run a sync XHR/equivalent that
> modifies the session to expire in a minute amount like 10
> seconds.
> * If the client does not issue a new request to the
> server, the session expire normally
> * If the client issues a new request before expiration,
> then the regular session expiration extension mechanism
> kicks in and extends the session.
> Actually, I might just do the above, sounds like fun!
>
> [...]
And what if the server requests arrive in an order different
from what you expected? --Antony
That was the point of the "sync XHR/equivalent" statement, to ensure
this request has run prior to the actual navigate event.
But as some would say, 'what if the network goes down and the request
cannot be completed?'; well, that has no negative effect compared to
the primary solution.