Skip to main content

Cleaning up sessions issue

Comments

4 comments

  • cPanelKenneth
    Hi, Which version of cPanel & WHM are you seeing this behavior on? scripts/clean_user_php_sessions should be running every 20 minutes, or so, removing those session files.
    0
  • ramasaig
    This issue has apparently not been addressed even yet. ALL the sessions on my server are stored at: '/var/cpanel/php/sessions/ea-php73/' (and there are also 'ea-php??' dirs for earlier versions of PHP). I cannot find a file called 'scripts/clean_user_php_sessions'. I do have one called '/usr/local/cpanel/scripts/cleanphpsessions' and another called '/usr/local/cpanel/scripts/cleanphpsessions.php', but neither are running automatically. I am running cPanel/WHM version 100.0.5. The session storage location is not of my choosing, but is presumably set by EasyApache? I have tried setting up a cron job for 'cleanphpsessions.php' but I get an error message: ' PHP Fatal error: Uncaught Error: Call to undefined function sqlite_open() in /home/webaditu/public_html/control/cleanphpsessions.php:10' I have also attempted to set up a cron job to run my own shell script, but I have found it impossible to change the ownership and/or permissions on the session files so that I can delete them. How can I delete outdated sessions automatically?
    0
  • cPanelAnthony
    @ramasaig It looks like the script is different now in 2021; can you let me know if this article helps? How to clean up session files
    0
  • ramasaig
    Thanks for your reply. This post has been overtaken by events. I did eventually find the file 'clean_user_php_sessions' and it seems to be running as a cron job (as intended). I could not get it to send me an e-mail, and I now realise that this is because there's no output. I can edit it to print 'success' when the script is run in Putty, but is this suffient to generate an e-mail? LATER: I have been able to receive e-mails from 'Cron' by editing the script to print 'success'. I have learned much in the process of working all this out!
    0

Please sign in to leave a comment.