Method Post with Javasript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Heinrich Klein

    #1

    Method Post with Javasript

    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



  • David Dorward

    #2
    Re: Method Post with Javasript

    Heinrich Klein wrote:
    [color=blue]
    > I have got an the Unload Handler is it possible when the Browser is closed
    > to send a Method post to a CGI program?[/color]

    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.

    --
    David Dorward http://dorward.me.uk/

    Comment

    • Richard Cornford

      #3
      Re: Method Post with Javasript

      "Heinrich Klein" <tocotronic9@gm x.at> wrote in message
      news:bpv237$1q6 nek$1@ID-135917.news.uni-berlin.de...[color=blue]
      >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[/color]

      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.


      Comment

      Working...