onClose question...

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

    #1

    onClose question...

    when the user goes to my site, and them closes the window, using "X" window
    decoration, i would like to log him out

    is it possible to add an onClose to current window ? is so how ?

    sample code is appreciated as always

    many thanks


  • Laurent Bugnion

    #2
    Re: onClose question...

    Hi,

    Mel wrote:[color=blue]
    > when the user goes to my site, and them closes the window, using "X" window
    > decoration, i would like to log him out
    >
    > is it possible to add an onClose to current window ? is so how ?
    >
    > sample code is appreciated as always
    >
    > many thanks[/color]

    It's absolutely impossible to have a reliable information about the user
    leaving your site. The only way to go is to observe his activity on the
    server, and to log him out after a timeout. Depending on the platform
    your server runs on, there may be built-in functions doing that.

    Laurent
    --
    Laurent Bugnion, GalaSoft
    Software engineering: http://www.galasoft-LB.ch
    Private/Malaysia: http://mypage.bluewin.ch/lbugnion
    Support children in Calcutta: http://www.calcutta-espoir.ch

    Comment

    • Mel

      #3
      Re: onClose question...

      i guess i did not pose the question correctly.

      what i mean is i need a callback when the browser is closed from window
      manager
      then i can do the rest !

      thanks,
      Mel
      "Laurent Bugnion" <galasoft-lb@bluewin.ch> wrote in message
      news:32m72eF3o4 ja4U1@individua l.net...[color=blue]
      > Hi,
      >
      > Mel wrote:[color=green]
      >> when the user goes to my site, and them closes the window, using "X"
      >> window decoration, i would like to log him out
      >>
      >> is it possible to add an onClose to current window ? is so how ?
      >>
      >> sample code is appreciated as always
      >>
      >> many thanks[/color]
      >
      > It's absolutely impossible to have a reliable information about the user
      > leaving your site. The only way to go is to observe his activity on the
      > server, and to log him out after a timeout. Depending on the platform your
      > server runs on, there may be built-in functions doing that.
      >
      > Laurent
      > --
      > Laurent Bugnion, GalaSoft
      > Software engineering: http://www.galasoft-LB.ch
      > Private/Malaysia: http://mypage.bluewin.ch/lbugnion
      > Support children in Calcutta: http://www.calcutta-espoir.ch[/color]


      Comment

      • Randy Webb

        #4
        Re: onClose question...

        Mel wrote:[color=blue]
        > i guess i did not pose the question correctly.[/color]

        You posed it properly, you just did not read the answer properly.
        [color=blue]
        > what i mean is i need a callback when the browser is closed from window
        > manager[/color]

        You have no reliable way to know that. How do you propose to have my
        browser send a message to a server if my power fails? Or, if I just turn
        it off? Or, if I have scripting disabled?
        [color=blue]
        > then i can do the rest ![/color]

        Then do it, and without depending on the client.

        --
        Randy
        comp.lang.javas cript FAQ - http://jibbering.com/faq

        Comment

        • Richard

          #5
          Re: onClose question...

          Mel wrote:
          [color=blue]
          > when the user goes to my site, and them closes the window, using "X"
          > window decoration, i would like to log him out[/color]
          [color=blue]
          > is it possible to add an onClose to current window ? is so how ?[/color]
          [color=blue]
          > sample code is appreciated as always[/color]
          [color=blue]
          > many thanks[/color]

          Just have a check done for activity.
          After an hour of no activity, log them out automatically.


          Comment

          • Oscar Monteiro

            #6
            Re: onClose question...

            <body onunLoad=window .alert("Thank you for your Visit");
            "Mel" <jmel@redolive. com> escreveu na mensagem
            news:6cc0d$41c5 c667$44a7759b$2 0943@msgid.mega newsservers.com ...[color=blue]
            > when the user goes to my site, and them closes the window, using "X"
            > window decoration, i would like to log him out
            >
            > is it possible to add an onClose to current window ? is so how ?
            >
            > sample code is appreciated as always
            >
            > many thanks
            >[/color]


            Comment

            • Grant Wagner

              #7
              Re: onClose question...

              So you're proposing a solution that results in an alert() that says
              "Thank you for your Visit" every time I navigate from one of the pages
              on his site to another page on his site?

              That's not a very nice way to treat people who come to your site.

              "Oscar Monteiro" <offm@hotmail.c om> wrote in message
              news:41c84845$0 $2602$a729d347@ news.telepac.pt ...[color=blue]
              > <body onunLoad=window .alert("Thank you for your Visit");
              > "Mel" <jmel@redolive. com> escreveu na mensagem
              > news:6cc0d$41c5 c667$44a7759b$2 0943@msgid.mega newsservers.com ...[color=green]
              > > when the user goes to my site, and them closes the window, using "X"
              > > window decoration, i would like to log him out
              > >
              > > is it possible to add an onClose to current window ? is so how ?
              > >
              > > sample code is appreciated as always
              > >
              > > many thanks[/color][/color]


              Comment

              Working...