<p dir="auto">Symfony 4.1.0</p>
<p dir="auto">Hello when I deploy my symfony application on my production server it does not work it shows me an error that is the following :</p>
<p dir="auto"><code class="notranslate">Attempted to call an undefined method named "hasBeenStarted" of class "Symfony\Component\HttpFoundation\Session\Session".</code></p>
<p dir="auto">Please can you help me to find a solution I must make the project today<br>
I am under symfony 7.2.7<br>
cordially</p>
<p dir="auto"><strong>Symfony version(s) affected</strong>: &gt;=4.0.12, &gt;=4.1.1</p>
<p dir="auto"><strong>Description</strong><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1055691/41904511-e146d426-7938-11e8-9243-54e1a03cde18.png"><img src="https://user-images.githubusercontent.com/1055691/41904511-e146d426-7938-11e8-9243-54e1a03cde18.png" alt="afbeelding" style="max-width: 100%;"></a></p>
<p dir="auto">After upgrading HttpFoundation to version <a href="https://github.com/symfony/symfony/releases/tag/v4.0.12">4.0.12</a> (due to a security issue reported by SensioLabs Security Checker), our web debug toolbar stopped working. Debugging this issue shows that there seems to be a mismatch between version 4.0.4 of HttpKernel and version 4.0.12 of HttpFoundation, because the method <a href="https://github.com/symfony/symfony/compare/v4.0.11...v4.0.12#diff-6ea44a1c02e94a4394cbc7076fe26bbeL149"><code class="notranslate">hasBeenStarted</code> has been removed from <code class="notranslate">Symfony\Component\HttpFoundation\Session\Session</code></a>.</p>
<p dir="auto">This sounds to me like a BC break. I'm not sure if we are supposed to upgrade all symfony packages at the same time, but I think the <code class="notranslate">composer.json</code> of <code class="notranslate">symfony/http-foundation</code> should at least contain a <code class="notranslate">conflicts</code> entry. I realize that the <code class="notranslate">hasBeenStarted</code> method was tagged as <code class="notranslate">@internal</code> but apparently it was being used in other Symfony components.</p>
<p dir="auto">Apparently this affects the web debug toolbar, but not our actual application.</p>
<p dir="auto"><a href="https://github.com/symfony/symfony/compare/v4.1.0...v4.1.1#diff-6ea44a1c02e94a4394cbc7076fe26bbeL149">The same issue seems to occur with version 4.1.1</a>.</p>
<p dir="auto"><strong>How to reproduce</strong><br>
Have symfony/http-foundation on version 4.0.12 and symfony/http-kernel on a lower version. Open the web interface with the debug toolbar enabled.</p>
<p dir="auto"><strong>Possible Solution</strong></p>
<ul dir="auto">
<li>Restore the <code class="notranslate">hasBeenStarted</code> method</li>
<li>Add a <code class="notranslate">conflicts</code> entry to the <code class="notranslate">composer.json</code> of HttpFoundation, to point out the conflict with older versions of HttpKernel</li>
</ul>
<p dir="auto"><strong>Additional context</strong><br>
This screenshot shows the request made by the web debug toolbar:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1055691/41903739-00ef0296-7937-11e8-96a2-ec6145d9073c.png"><img src="https://user-images.githubusercontent.com/1055691/41903739-00ef0296-7937-11e8-96a2-ec6145d9073c.png" alt="afbeelding" style="max-width: 100%;"></a></p>
<p dir="auto">Installed Symfony components with their versions (from <code class="notranslate">composer show symfony/*</code>):<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1055691/41904612-1f85c828-7939-11e8-8302-f84a9b450c2b.png"><img src="https://user-images.githubusercontent.com/1055691/41904612-1f85c828-7939-11e8-8302-f84a9b450c2b.png" alt="afbeelding" style="max-width: 100%;"></a></p>