Function to purge old sessions.