Welcome Guest, Not a member yet? Register   Sign In
Manage Session folder

I have noticed that my 'writable/session' folder on the server is getting massive. Is there a way to flush/delete these files automatically. 

Thanks for the reference.
Below is my setting but it's not deleting the files.

$sessionRegenerateDestroy = false;

i'm on linux , this cleared my session dir and left the index.html intact
sudo rm                            /srv/http/ads.com/writable/session/ci_*

So if you set up a cron job as root , using something similar at a good estimated time interval , then that would periodically clear,

I assume the server is linux OS ?
I use Arch Linux by the way 

CMS in Action

Do not use manual removal. When switch to table storage, you need to generate new cleanup code.
Set session.gc_probability or execute session_gc() in cron script. The function will work with tables and files, comparing session times

Hi All,

Yes I'm on Linux (ubuntu). I thought Ci was capable to clean the sessions it self.
I got about 4 separate sites running via virtual servers so I'm not quite sure how I can clean all 4 session folders via "session_gc()" with cron.

Create controller with run() method
Write session_gc() in action
Set task to cron: * * * * * wget -O http://site.com/cron/run

Thanks Ozornick. Your solution worked perfect.

Theme © iAndrew 2016 - Forum software by © MyBB