# Cgi/session , deleting old sessions

**URL:** <https://www.ruby-forum.com/t/cgi-session-deleting-old-sessions/148561>\
**Category:** Ruby\
**Created:** [September 15, 2008, 1:59am UTC](https://www.ruby-forum.com/t/cgi-session-deleting-old-sessions/148561 "2008-09-15T01:59:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sovok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5a626/32.png) [@sovok](https://www.ruby-forum.com/u/sovok)\
**Post date:** [September 15, 2008, 1:59am UTC](https://www.ruby-forum.com/t/cgi-session-deleting-old-sessions/148561/1 "2008-09-15T01:59:12Z")

</div>

Hi,

I am wondering how I would go about deleting files created by  
CGI::Session, there is a huge build up of files in /tmp(everytime a new  
session is initiated a new one is created) and I can’t think of anyway  
(beside a crontab) of deleting them, or I could use the .delete method  
supplied by cgi/session but this way i need to count on the user logging  
out so i can call .delete, not very efficient either.  
I looked into using MemoryStore but the eruby instance doesn’t last long  
enough.

Any help is greatly appreciated,  
rob
