?
avatar sajalaspl
sajalaspl
20 Jun 2018

Steps to reproduce the issue

  • Set session handler to "Redis"
  • Set session lifetime to 30 in Global Configuration

Expected result

It should clear older/garbage entries from kar_session mysql table older than 30 minutes.

Actual result

The session table is ever growing, nothing is deleted from the table.

System information (as much as possible)

PHP Built On Linux 4.9.76-3.78.amzn1.x86_64 #1 SMP Fri Jan 12 19:51:35 UTC 2018 x86_64
Database Type mysql
Database Version 5.5.5-10.0.24-MariaDB
Database Collation latin1_swedish_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 7.0.25
Web Server nginx/1.12.1
WebServer to PHP Interface fpm-fcgi
Joomla! Version Joomla! 3.8.8 Stable [ Amani ] 22-May-2018 14:00 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Additional comments

I am wondering why the Joomla uses session table even though I've set Redis as session handler. And even though, it's using that, why the older entries are not deleted from it. My session table is now 3GB slowing down whole site for logged in users and admin back-end.

avatar sajalaspl sajalaspl - open - 20 Jun 2018
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jun 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Jun 2018
avatar joomdonation
joomdonation - comment - 20 Jun 2018

Could you please check and make sure:

  1. Plugin System - Session Data Purge is enabled
  2. Parameter Enable Session Metadata Cleanup in the plugin set to Yes
  3. Probability set to a number != 0? If it set to 1 (by default), maybe you should try to set it to 100, then refresh the page for few times and check data in session table again?
avatar sajalaspl
sajalaspl - comment - 20 Jun 2018

@joomdonation I can not find any plugin with such name "Session Data Purge".

avatar joomdonation
joomdonation - comment - 20 Jun 2018

If so, I guess your update was not success for some reasons. Try to go to Extensions -> Manage -> Discover to discover, install and publish that missing plugin. After that, your issue should be sorted

avatar sajalaspl
sajalaspl - comment - 20 Jun 2018

@joomdonation Ok let me do it right away, a sec.

avatar sajalaspl
sajalaspl - comment - 20 Jun 2018

@joomdonation Ok, I've found out and installed it. Before enabling it, what would be the ideal settings? I've set Redis as my session handler. And 30 minutes is the session lifetime in Global Config.

avatar joomdonation
joomdonation - comment - 20 Jun 2018

Use default setting should be enough. Since you use Redis, you can set Enable Session Data Cleanup to No.

However, with that default setting, you will have to wait sometime to see the data in the table cleaned up. By default, Probability = 1, Divisor = 100 mean there is 1% of chance the process is run. If you want the data is cleaned up right now, set Probability parameter to 100, then fresh the page and the data should be cleaned up. After that, set Probability back to 1.

avatar brianteeman
brianteeman - comment - 20 Jun 2018

Closed as not a bug

avatar brianteeman brianteeman - close - 20 Jun 2018
avatar brianteeman brianteeman - change - 20 Jun 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-06-20 08:58:44
Closed_By brianteeman
avatar sajalaspl
sajalaspl - comment - 20 Jun 2018

@joomdonation Ok many thanks, I just did set probability to 100 and almost everything got cleaned up.

But regarding your first comment, if I'm using Redis, I should set Enable Session Data Cleanup to "No". If I set it to No, don't you think so the table will be flooded again?

avatar sajalaspl
sajalaspl - comment - 20 Jun 2018

Since, I've noticed that, even though I used Redis as session handler, Joomla makes entry in the session table.

And does this plugin also removes "Remember me" sessions, as we've lots of users using this feature?

avatar joomdonation
joomdonation - comment - 20 Jun 2018

No, don't worry. You only need to set it to Yes if you use Database Handler on your site (If I remember correctly). You can leave it to Yes if you want to be safe.

For your last question, as of right now, Joomla stores something called session meta data in that same table, so even if you use Redis as session handler, there will be data stored in that table. This issue however, will be addressed in Joomla 4 (details explanation can found somewhere in this repo, you can search for it if you want).

avatar sajalaspl
sajalaspl - comment - 20 Jun 2018

Million thanks @joomdonation that cleared many things.

Add a Comment

Login with GitHub to post a comment