<p dir="auto">Hello,</p>
<p dir="auto">I spent a few hours debugging my system the other day because my disk was full - not because of space but because of inodes. In fact, it was the cache sessions directory that was full of sess_* files.</p>
<p dir="auto">As it was already stated in pr <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="953389" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/1097" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/1097/hovercard" href="https://github.com/symfony/symfony/pull/1097">#1097</a>, on systems like Debian, the default session.gc_probability is defined to 0, and a cron task takes care of the /var/lib/php5 directory, which is the default session.save_path.</p>
<p dir="auto">But by default, Symfony changes that behavior and puts the sessions in the cache directory of the environment, which is then never garbage collected. If you don't "cache:clear" your environment periodically, you'll be running out of inodes sooner or later (I had some scripts using my webservices, which created sessions over and over again).</p>
<p dir="auto">I think this issue should be at least documented in session management of the HttpFoundation. But maybe I could also modify the cache:clear task or create a new one, that would only run the garbage collection of sessions. Or do you think it is  enough to document that you need to modify the /etc/cron.d/php5 file to change the directory and add more lines for the different environments ?</p>
<p dir="auto">Regards.</p>
<p dir="auto">I had a strange behavior while learning with the Symfony Book Chapter "Forms".</p>
<p dir="auto">For revision:</p>
<ol dir="auto">
<li>Creating the Class:</li>
</ol>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// src/Acme/TaskBundle/Entity/Task.php
namespace Acme\TaskBundle\Entity;

class Task
{
    protected $task;

    protected $dueDate;

    public function getTask()
    {
        return $this-&gt;task;
    }
    public function setTask($task)
    {
        $this-&gt;task = $task;
    }

    public function getDueDate()
    {
        return $this-&gt;dueDate;
    }
    public function setDueDate(\DateTime $dueDate = null)
    {
        $this-&gt;dueDate = $dueDate;
    }
}"><pre class="notranslate"><span class="pl-c">// src/Acme/TaskBundle/Entity/Task.php</span>
<span class="pl-k">namespace</span> <span class="pl-v">Acme</span>\<span class="pl-v">TaskBundle</span>\<span class="pl-v">Entity</span>;

<span class="pl-k">class</span> <span class="pl-v">Task</span>
{
    <span class="pl-k">protected</span> <span class="pl-c1"><span class="pl-c1">$</span>task</span>;

    <span class="pl-k">protected</span> <span class="pl-c1"><span class="pl-c1">$</span>dueDate</span>;

    <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">getTask</span>()
    {
        <span class="pl-k">return</span> <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">task</span>;
    }
    <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">setTask</span>(<span class="pl-s1"><span class="pl-c1">$</span>task</span>)
    {
        <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">task</span> = <span class="pl-s1"><span class="pl-c1">$</span>task</span>;
    }

    <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">getDueDate</span>()
    {
        <span class="pl-k">return</span> <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">dueDate</span>;
    }
    <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">setDueDate</span>(<span class="pl-smi"><span class="pl-smi">\<span class="pl-v">DateTime</span></span></span> <span class="pl-s1"><span class="pl-c1">$</span>dueDate</span> = <span class="pl-c1">null</span>)
    {
        <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">dueDate</span> = <span class="pl-s1"><span class="pl-c1">$</span>dueDate</span>;
    }
}</pre></div>
<ol dir="auto">
<li>Editing the controller:</li>
</ol>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// src/Acme/TaskBundle/Controller/DefaultController.php
namespace Acme\TaskBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Acme\TaskBundle\Entity\Task;
use Symfony\Component\HttpFoundation\Request;

class DefaultController extends Controller
{
    public function newAction(Request $request)
    {
        // create a task and give it some dummy data for this example
        $task = new Task();
        $task-&gt;setTask('Write a blog post');
        $task-&gt;setDueDate(new \DateTime('tomorrow'));

        $form = $this-&gt;createFormBuilder($task)
            -&gt;add('task', 'text')
            -&gt;add('dueDate', 'date')
            -&gt;getForm();

        return $this-&gt;render('AcmeTaskBundle:Default:new.html.twig', array(
            'form' =&gt; $form-&gt;createView(),
        ));
    }
}"><pre class="notranslate"><span class="pl-c">// src/Acme/TaskBundle/Controller/DefaultController.php</span>
<span class="pl-k">namespace</span> <span class="pl-v">Acme</span>\<span class="pl-v">TaskBundle</span>\<span class="pl-v">Controller</span>;

<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Bundle</span>\<span class="pl-v">FrameworkBundle</span>\<span class="pl-v">Controller</span>\<span class="pl-v">Controller</span>;
<span class="pl-k">use</span> <span class="pl-v">Acme</span>\<span class="pl-v">TaskBundle</span>\<span class="pl-v">Entity</span>\<span class="pl-v">Task</span>;
<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">HttpFoundation</span>\<span class="pl-v">Request</span>;

<span class="pl-k">class</span> <span class="pl-v">DefaultController</span> <span class="pl-k">extends</span> <span class="pl-v">Controller</span>
{
    <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">newAction</span>(<span class="pl-smi"><span class="pl-smi">Request</span></span> <span class="pl-s1"><span class="pl-c1">$</span>request</span>)
    {
        <span class="pl-c">// create a task and give it some dummy data for this example</span>
        <span class="pl-s1"><span class="pl-c1">$</span>task</span> = <span class="pl-k">new</span> <span class="pl-v">Task</span>();
        <span class="pl-s1"><span class="pl-c1">$</span>task</span>-&gt;<span class="pl-en">setTask</span>(<span class="pl-s">'Write a blog post'</span>);
        <span class="pl-s1"><span class="pl-c1">$</span>task</span>-&gt;<span class="pl-en">setDueDate</span>(<span class="pl-k">new</span> \<span class="pl-v">DateTime</span>(<span class="pl-s">'tomorrow'</span>));

        <span class="pl-s1"><span class="pl-c1">$</span>form</span> = <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">createFormBuilder</span>(<span class="pl-s1"><span class="pl-c1">$</span>task</span>)
            -&gt;<span class="pl-en">add</span>(<span class="pl-s">'task'</span>, <span class="pl-s">'text'</span>)
            -&gt;<span class="pl-en">add</span>(<span class="pl-s">'dueDate'</span>, <span class="pl-s">'date'</span>)
            -&gt;<span class="pl-en">getForm</span>();

        <span class="pl-k">return</span> <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">render</span>(<span class="pl-s">'AcmeTaskBundle:Default:new.html.twig'</span>, <span class="pl-en">array</span>(
            <span class="pl-s">'form'</span> =&gt; <span class="pl-s1"><span class="pl-c1">$</span>form</span>-&gt;<span class="pl-en">createView</span>(),
        ));
    }
}</pre></div>
<ol dir="auto">
<li>Creating the template:</li>
</ol>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{# src/Acme/TaskBundle/Resources/views/Default/new.html.twig #}
&lt;form action=&quot;{{ path('task_new') }}&quot; method=&quot;post&quot; {{ form_enctype(form) }}&gt;
    {{ form_widget(form) }}

    &lt;input type=&quot;submit&quot; /&gt;
&lt;/form&gt;"><pre class="notranslate">{<span class="pl-c"># src/Acme/TaskBundle/Resources/views/Default/new.html.twig #}</span>
&lt;form action="<span class="pl-s">{{ path('task_new') }}</span>" method="post"<span class="pl-s"> {{ form_enctype(form) }}&gt;</span>
<span class="pl-s">    {{ form_widget(form) }}</span>
<span class="pl-s"></span>
<span class="pl-s">    &lt;input type=</span>"submit" /&gt;
&lt;/form&gt;</pre></div>
<p dir="auto">Following these steps I got a strange behaviour after creating the route and opening the page. The DueDate didn't look like at the picture in the book. It was more like ''Jan-012345678-2013" instead of "Jan 10, 2013". After debugging for 4 hours (I'm a web developer trainee) I found out that it has to do with the intl extension cause the date field type uses for formatting('format') per default: IntlDateFormatter::MEDIUM. After installing intl everything was alright :) But I would expect an exception at 'format' when intl is not installed.<br>
This is my first "bug" report. Any criticism would be desirable :)</p>