title: delete session files after a time from creation
body: <p>I am saving my sessions in another directory from /temp directory.
  say <code>/session</code> directory.( using <code>session_save_path("session")</code> )</p>
  
  <p>also, there is a code to kill the session after 10 minuets from creation and logout.</p>
  
  <p>but I mentioned that if the user logs in and for example shut down his computer, my log out and session destroy code doses not run, so the session file will remain in the session directory.</p>
  
  <p>I wanted to know is there is a way to delete session files in <code>/session</code> after a time from creation?</p>
  
  <p>I used this code for it </p>
  
  <pre><code>  if ($handle = opendir('sessions')) {
  
      while (false !== ($file = readdir($handle))) {
          if (filectime($file)&lt; (time()-600)) {  // 600 = 10*60
          unlink($file);
          }
      }
    }
  </code></pre>
  
  <p>but, not working, I think it couldn't get the creation time by <code>filectime($file)</code></p>
  
  <p>thanks </p>