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

XF 1.4 xf_session never removed

#1
Hello,

Records in the xf_session table on one of our larger XF installs never seems to clean up after itself. We have enabled memcache in the config and it appears to be working but the sessions table never empties.

Can you please provide some direction if anyone has noticed this before? We searched around quite a bit but can't see where someone has had this specific issue.
 

Mike

XenForo developer
Staff member
#2
If you've enabled Memcache for sessions, then the xf_session table isn't used and won't be touched. It can be emptied manually.
 
#3
Mike,

That makes sense. Enabling memcache definitely alters the way sessions are handled but why would xf_session be populated with data even with memcache enabled? The table continues to grow. Please let us know if there is anything else we can check as all the cron entries look good etc.
 

Mike

XenForo developer
Staff member
#4
Well enabling Memcache and using it for sessions are separate configuration settings (https://xenforo.com/help/cache/).

If the table is getting bigger, then presumably you're not caching sessions. The session table is cleaned up every hour and expired sessions are removed. You can confirm this by looking at the expiry_date column in the table.
 
#5
Mike-

Is there some way to tell why the sessions would not be cleaned up? We've verified the cron daily and hourly cleanup jobs are enabled and running.
 

Mike

XenForo developer
Staff member
#6
If the cron is running, then the method is running. Have you confirmed that you have expiry_date values (timestamps) far in the past?
 
#8
Hello,

The variable is not defined by default, we haven't set $config['cache']['cacheSessions'] to true manually , we just enabled memcache as outlined here: https://xenforo.com/help/cache/

Should we try to force the variable above to false? There's 600,000 entries in the session table since it was manually truncated yesterday. The oldest timestamp is one with timestamp 1413341265 which is when we manually truncated the table. Is there anything else we can check here? We can also revert session cache back to another option for testing.
 

MattW

Well-known member
#9
Hello,

The variable is not defined by default, we haven't set $config['cache']['cacheSessions'] to true manually , we just enabled memcache as outlined here: https://xenforo.com/help/cache/

Should we try to force the variable above to false? There's 600,000 entries in the session table since it was manually truncated yesterday. The oldest timestamp is one with timestamp 1413341265 which is when we manually truncated the table. Is there anything else we can check here? We can also revert session cache back to another option for testing.
You aren't caching your sessions in memcached if you don't have the config value that Chris mentioned previously.