1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is xf_session table supposed to be empty?

Discussion in 'XenForo Questions and Support' started by LPH, Jan 8, 2013.

  1. LPH

    LPH Well-Known Member

    I noticed that the xf_session is always empty. The xf_session_activity has data but the xf_session_admin is also empty.

    Is this normal?

    Update: I just checked my local installation and there is an entry. :(
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It will be empty if no one is logged into the forum.
     
  3. LPH

    LPH Well-Known Member

    But I am logged into the forum :(

    I log into the forum, check database, and nothing changes. In contrast, the local install updates immediately.
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Then there should be a session record. I have no explanation for otherwise.
     
  5. robdog

    robdog Well-Known Member

    Are you using memcache? If you are, you will not see sesssion information in the database since it is stored through memcache.
     
    Jake Bunce likes this.
  6. LPH

    LPH Well-Known Member

    Thank you both for replying. No, I'm not using memcache.

    Could the database table be corrupt? I've tried a repair, tried to compare local and live tables for xf_session and they look the same.
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Are you using any cache at all? APC, memcache, file, etc. It would be defined in your library/config.php file.

    Or maybe you are looking at the wrong database?
     
  8. Onimua

    Onimua Well-Known Member

    xf_session seems to only be used for when a user is logged into the ACP at the moment.
     
  9. Chris D

    Chris D XenForo Developer Staff Member

    Not sure that's correct.

    There's an xf_session_admin table for ACP sessions.
     
  10. Jeremy P

    Jeremy P Well-Known Member

    My xf_session table is also empty but we store sessions in cache using APC.. do you use a cache extension?
     
  11. LPH

    LPH Well-Known Member

    The /library/config.php has

    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['cacheSessions'] = true;
    $config['cache']['backend'] = 'File';
    $config['cache']['backendOptions'] ['cache_dir'] = '/path/to/tuxreportsnetwork.com/community/internal_data/cache';
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
     
    $config['cache']['backend'] = 'File';
    $config['adminLogLength'] = 30;
    So, maybe I should be looking into that folder to see the sessions are being written there.

    Update: Oh my ! There are tons of files in that folder ending with the session. Very cool. Sad news for my idea on something else. Oh well.
     
  12. Jeremy P

    Jeremy P Well-Known Member

    They are ;)
     
    LPH likes this.
  13. LPH

    LPH Well-Known Member

    Yes. :oops:
     
  14. Onimua

    Onimua Well-Known Member

    I just tried it on my localhost before I posted that and found it to be true in that instance. I didn't look too deep past that, only found one thing that didn't leave it empty. Clearly it seems something that's setting-based.
     
  15. Jeremy P

    Jeremy P Well-Known Member

    As above, it's because sessions are being stored in the cache because of how config.php is set.
     
  16. Cool

    Cool Active Member

    may usefull for them wich may integrate the blab chat(http://hot-things.net/)
    the session cache has to be set to "false" otherweise the chat is not able to get the session id for the users.

    may the chat-programmer change that in future.
     

Share This Page