Greetings,I noticed, while performing backup tasks of a osticket installation, the size of the database. The ost_session table, has a Data Length of about 3,2 GB (~6.800.000 Rows).This seems for me quite too large. My question is now aren't these entries cleaned up normally after a while automatically? and can i drop the data of the ost_session table safely manually while the web server is shut down?Best regards.osTicket-Versionv1.10 (901e5ea)Server-SoftwareApache/2.4.10 (Debian)MySQL-Version5.5.55PHP-Version5.6.30-0+deb8u1php sessionSession Support enabledsession.auto_start Offsession.cache_expire 180session.cache_limiter nocachesession.cookie_lifetime 0session.gc_maxlifetime 1440session.serialize_handler phpSystem Log of osTicketDB Error #1062 Error Mon, 9 Jan 2017 04 XX.XXX.XX.XXXUpgrader - 0d6099a6-98ad7d55 cleanup Debug Wed, 7 Dec 2016 19 XX.XXX.XXX.X(... older)Details about DB Error #1062: Duplicate entry 'n1nu975bn34q6pj4532fdglscp1' for key 'PRIMARY' #0 (root)/include/mysqli.php(204): osTicket->logDBError('DB Error #1062', '[INSERT INTO `o...') #1 (root)/include/class.orm.php(3133): db_query('INSERT INTO `os...', true, true) #2 (root)/include/class.orm.php(597): MySqlExecutor->execute() #3 (root)/include/class.ostsession.php(216): VerySimpleModel->save() #4 (root)/include/class.ostsession.php(158): DbSessionBackend->update('n1nu975bn34q6pj...', 'csrf|a:{s:"...') #5 : SessionBackend->write('r1nu042bn34q6pj...', 'csrf|a:{s:"...') #6 : session_write_close()

Do you run Cron?Mine is 21 entries.

Which cron job exactly do you mean? (the last entry in ost_session.session_expire is from 2015)

The cron.php file that comes with osTicket.

I thought the cron.php file is related to POP3/IMAP mail fetching - which is disabled in my configuration.Is it somewhere written what this php file is doing exactly?Edit:I run the script (php -f /path/api/cron.php) but it took only 1-2 sec and I think it didn't changed anything.And there's no new log entry after running the command from above.

Q: Is it somewhere written what this php file is doing exactly?A: No.I believe that more and more thing (not just email) are becoming more dependent on things like cron.php, such as clean up triggers, etc. Personally if it was me i would just nuke any sessions over 30 days.

You can actually drop the table if you want and it will rebuild itself automatically.

    If you are not running cron it should clean up on auto-cron also.  Dropping the contents of that table is fine and doesn't harm anything.  It will start to re-populate with new sessions as they occur.  Anyone currently logged in of course may need to log in again though.

    I deleted all entries older then 1 day.But which cron job did you mean with auto-cron? Because osTicket didn't deleted any entries by itself.

    6 years later

    KevinTheJedi

    Don't do this as for me at least I had to manually recreate the table. Instead use the TRUNCATE TABLE command, of which you can make a periodic event:
    CREATE EVENT update_date_column
    ON SCHEDULE EVERY 1 WEEK STARTS NOW()
    DO TRUNCATE TABLE ost_session;

    Write a Reply...