Menu

#521 Users_cnxn ageing does not work

CVS
open-accepted
Users (45)
5
2009-03-24
2009-03-14
Chris Stone
No

users/BitUser is supposed to delete sessions from users_cnxn however the following around line 958 appears to be wrong:

I believe this:
$oldy = $update['last_get'] - ($gBitSystem->getConfig( 'users_cnxn_history_days', 30 ) * 24 * 60);
should read:
$oldy = $update['last_get'] - ($gBitSystem->getConfig( 'users_cnxn_history_days', 30 ) * 24 * 60 * 60);

otherwise sessions < 12 hours old would be deleted.

and this:
$query = "DELETE from `".BIT_DB_PREFIX."users_cnxn` where `connect_time`<?";
should read:
$query = "DELETE from `".BIT_DB_PREFIX."users_cnxn` where `last_get`<?";

as connect_time never seems to be populated!

I also believe this:

// Delete old connections nightly during the hour of 3 am
if( date( 'H' ) == '03' && date( 'i' ) > 0 && date( 'i' ) < 2 ) {

is too restrictive. I think this is saying that sessions will only be aged out if someone happens to be using the site between 3:00 and 3:01 AM ?

Discussion

  • Lester Caine

    Lester Caine - 2009-03-24
    • assigned_to: nobody --> lsces
    • status: open --> open-accepted
     
  • Lester Caine

    Lester Caine - 2009-03-24

    Yep - this is a little screwy.
    `connect_time` is not used as far as I can see, and I think that it could probably be dropped, except that it would be nice to be logging user access.
    I've made a couple of these changes locally here, but these are the right answer.
    Since this table is used to display active users, should it not be cleared down a little more frequently?

    This is an area I am plying with myself, since the 'located' login for my client management systems needs to know exactly who is logged in where, and requires users to log out, but this also needs a 'backup' log off. Which may require a scheduled update?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.