Logging Off

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

    Logging Off

    Hello, Can anoyone help me with the following:

    I have a application online using ASP in which users log in and log out.
    However, a lot of users simply close the window, bypassing my log-out
    script. I have tried using the Javascript onUnload function with success,but
    refreshing the screen also triggers this at the wrong time, Has anyone got
    any suggestions?

    Thanks in advance,

    Gram


  • Mike

    #2
    Re: Logging Off

    Create a frame structure and put the unLoad listener on the window that
    contains the frames (the top window). That way the frame containing your app
    can change URLs willy nilly, but the unLoad event with your log off routine
    won't happen until the top window is unloaded.

    Mike



    "Gram" <gram3000@hotma il.com> wrote in message
    news:voHBb.241$ HR.912@news.ind igo.ie...[color=blue]
    > Hello, Can anoyone help me with the following:
    >
    > I have a application online using ASP in which users log in and log out.
    > However, a lot of users simply close the window, bypassing my log-out
    > script. I have tried using the Javascript onUnload function with[/color]
    success,but[color=blue]
    > refreshing the screen also triggers this at the wrong time, Has anyone got
    > any suggestions?
    >
    > Thanks in advance,
    >
    > Gram
    >
    >[/color]


    Comment

    • Michael Winter

      #3
      Re: Logging Off

      Mike wrote on 10 Dec 2003 at Wed, 10 Dec 2003 16:56:26 GMT:
      [color=blue]
      > Create a frame structure and put the unLoad listener on the
      > window that contains the frames (the top window). That way the
      > frame containing your app can change URLs willy nilly, but the
      > unLoad event with your log off routine won't happen until the
      > top window is unloaded.[/color]

      What if my browser crashes? What if I disconnect before logging off?
      What if my browser doesn't execute onunload events[1]?

      Important actions should be carried out as soon as the user does
      something that makes those actions necessary. For example, if you are
      recording preferences that are in-line, rather than on a separate
      page, and the user changes an option, that preference should be
      recorded immediately.

      The logging off process should be able to occur in two ways: when the
      user clicks a 'Log Out' link or button, or after a certain period of
      inactivity. Both should do the same things, but only the former
      should require user interaction or presence.

      Mike

      The only thing you can guarantee is that user's don't follow
      instructions.


      [1] When I was trying to record preferences with onunload (before I
      took the advice above), I found that Opera didn't do anything, while
      IE did. I tried putting window.open() calls, alert boxes, page
      changes, and cookie creation statements into the event, one at a
      time, but none of them worked. I assume then, that Opera doesn't
      support onunload.

      --
      Michael Winter
      M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk")

      Comment

      • Lasse Reichstein Nielsen

        #4
        Re: Logging Off

        "Gram" <gram3000@hotma il.com> writes:
        [color=blue]
        > I have a application online using ASP in which users log in and log out.
        > However, a lot of users simply close the window, bypassing my log-out
        > script.[/color]

        A very common problem, and there is no safe solution. Remember, the
        user might not even be connected to the internet, when he closes the
        browser. With that in mind, you might as well change your session
        design to using a timeout.
        [color=blue]
        > I have tried using the Javascript onUnload function with success,but
        > refreshing the screen also triggers this at the wrong time, Has anyone got
        > any suggestions?[/color]

        Instead of sending a logout command with the onunload handler, send a
        "log me out in 20 seconds unless you hear from me again" command. If
        the page is refreshed, you know you can ignore it. Otherwise you can
        log him out after 20 seconds. Pick a time that is not too short, based
        on the normal behavior of yuor users.

        /L
        --
        Lasse Reichstein Nielsen - lrn@hotpop.com
        DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
        'Faith without judgement merely degrades the spirit divine.'

        Comment

        Working...