Ubuntu – PHP Sessions directory is filling up and overflowing

apache-2.2PHPUbuntu

Running PHP, Apache2… Our login stopped working and anything trying to grab session data. It all stopped working randomly at 7pm last night.
I found out the sessions directory is being filled with tons of sessions per second. If I remove all the sessions it fills up quickly again. Access logs for some reason have stopped working.
Does this sound like an attack… If so what can I do to stop it?

Best Answer

It sounds like the code you are using to close a session is not working, or does not exist. You need to destroy the sessions using the following:

To destroy all sessions:

<?php
session_destroy();
?>

or use this to destroy individual pieces:

<?php
if(isset($_SESSION['views']))
  unset($_SESSION['views']);
?>

Taken from here: W3Schools PHP Sessions