Logout problem.

Discussion in 'Programming' started by tolgafiratoglu, Sep 25, 2007.

  1. #1
    We're currently looking for best logout system, which will not be bad for performance.

    * we logout users with a link it's ok.

    * ...but as you know most users don't use logout link.

    * we can use a Javascript, which can check if the [X] of browser is clicked, I mean when the browser is closed. We'll do it. But:
    i. It has cross browser problems.
    ii. It's not a guarantee.

    We should somehow trace "last-logout" time, timestamp or datetime...

    We don't want to trace users by updating "lastLogin" it's very costly to work an SQL in every refresh.

    It needs Cron Job and AJAX check. But we couldn't model a good-performance logout system.

    And good-model offer?
     
    tolgafiratoglu, Sep 25, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Use a cookie that expires as soon as the browser is closed.
     
    nico_swd, Sep 25, 2007 IP
  3. tolgafiratoglu

    tolgafiratoglu Well-Known Member

    Messages:
    249
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #3
    nico thanks but I was looking a server side solution, since I want to show "online users"
     
    tolgafiratoglu, Sep 25, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    Well... updating a "last activity" row with every page load isn't as bad as you may think. vBulltin does it and many many others. If you LIMIT your query to 1 so that it stops searching the other rows after the first match, you'll get best performance, and it's just a small query which doesn't hurt anything.

    Digitalpoint has 1,783 users online right now, and it's using the database system... do you have more than that?


    Plus, I'm afraid that's the only way to go about this...
     
    nico_swd, Sep 25, 2007 IP