sessionvbulletin

What does the loggedin column of vBulletins session table mean?


In vBulletin 4.2 the session table has a column loggedin. Since VB doesn't seem to have a official database documentation, I want to know what exactly it means because the column it's a SMALLINT instead of simple boolean value.

My previous reverse engineering: 0 means not logged in. 1 and 2 is used for logged in users, but I can't see what's the difference. I have both regular user session and admin panel sessions with loggedin=2.

Tried to get more information by running grep on vBulletins php files, without luck .

So my concrete questions are:


Solution

  • I learned that my filter to *.php files broke greps recursive scanning method. The correct command to scan all php files for 'loggedin' (in quotes since vB use them this way on it's $vbulletin->session object) is:

    grep -rn --include \*.php "'loggedin'" .
    

    This gave a few results. Most interesting:

    ./includes/functions.php:7558:                  $vbulletin->session->set('loggedin', 2);
    

    Opening functions.php we see the call and we can feel lucky that at least in the code vB developers to decide that a comment would be usefull:

    if ($vbulletin->session->vars['loggedin'] == 1 AND !$vbulletin->session->created)
    {
          # If loggedin = 1, this is out first page view after a login so change value to 2 to signify we are past the first page view
          # We do a DST update check if loggedin = 1
          $vbulletin->session->set('loggedin', 2);
          // ...
    }
    

    So we can say that 1/2 doesn't gave information about the type of session. It could be a regular user or also admin session. Altough loggedin indicates if the user already viewed some other pages or not, whyever vB devs need to devide this.