SessionHandlerInterface write method not being called
<p>So I have created a class implementing SessionhandlerInterface and set it as a session handler:</p>

<pre><code>$sessionHandler = new SessionHandler();
session_set_save_handler($sessionHandler);
session_start();
</code></pre>

<p>The problem is, the write function is never called.</p>

<p>If I use the second parameter of session_set_save_handler and set it to false:</p>

<pre><code>session_set_save_handler($sessionHandler, false);
</code></pre>

<p>Then it works properly. Can somebody explain this behaviour to me? I am using PHP 5.4.6.</p>

<p>In the documentation there is written:</p>

<blockquote>
  <p>When using objects as session save handlers, it is important to register the shutdown function with PHP to avoid unexpected side-effects from the way PHP internally destroys objects on shutdown and may prevent the write and close from being called. Typically you should register 'session_write_close' using the register_shutdown_function() function.</p>
</blockquote>

<p>As of PHP 5.4.0 you can use session_register_shutdown() or simply use the 'register shutdown' flag when invoking session_set_save_handler() using the OOP method and passing an instance that implements SessionHandlerInterface.</p>

<p>But I don't fully understand that.</p>
