title: Use Session with Silex and cUrl
body: <p>I'm making an application and I need to authenticate users with a POST cUrl call:</p>
  
  <pre><code>$app = new Silex\Application();
  
  $app-&gt;register(new Silex\Provider\SessionServiceProvider());
  
  $app['debug'] = true;
  
  $app-&gt;post('/api/auth/login', function (Request $request) use ($app) {
      if ($request-&gt;get('username') === 'admin' &amp;&amp; $request-&gt;get('password') === 'admin') {
          return $app-&gt;json(array('sessionId' =&gt; $app['session']-&gt;getId()));
      } else {
          $error = array('message' =&gt; 'Authentication failed');
          return $app-&gt;json($error, 404);
      }
  });
  </code></pre>
  
  <p>when I use: </p>
  
  <pre><code>curl -X POST -d username=admin -d password=admin http://app.local/api/auth/login
  </code></pre>
  
  <p>every time my application returns me a different session identifier!</p>