Method Post with Javasript

H

Heinrich Klein

Hello

I have got an the Unload Handler is it possible when the Browser is closed
to send a Method post to a CGI program? If yes how can i do this normally i
need to push a Button. Thanks for your help
 
D

David Dorward

Heinrich said:
I have got an the Unload Handler is it possible when the Browser is closed
to send a Method post to a CGI program?

Maybe if you muck about with popups - which a lot of people block. But you
can't tell the difference between the window being closed, the user
following a link, the user typing in an address or the user opening a
bookmark (etc).

You also can't do anything about people disconnecting from the network while
the browser is still open.

HTTP is stateless, live it with.
 
R

Richard Cornford

Heinrich Klein said:
I have got an the Unload Handler is it possible when the Browser
is closed to send a Method post to a CGI program? If yes how can
i do this normally i need to push a Button. Thanks for your help

Forget it. You cannot do anything like that in onunload events reliably.
Once the browser gets the idea that is closing down it stops bothering
to send requests to servers, probably assuming that there would be no
point as it won't be around to receive any responses it may get.

But the request for this functionality is usually to do with some
server-side log off or clean up and demonstrates a lack of appreciation
of the nature of HTTP as a stateless protocol. Usually, in the event of
a user not logging themselves out actively (so most of the time) the
point at which you sort out finalising the state of whatever it is on
the server that may need finalising is when the user's session times
out.

Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top