<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.2.2</td>
</tr>
</tbody>
</table>
<p dir="auto">I'm getting an exception whilst using Browser-Kit whereby, if the response returns a <code class="notranslate">Set-Cookie</code> expiration time that's in the past, it throws the an exception like the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Fatal error: Uncaught UnexpectedValueException: The cookie expiration time &quot;-39600&quot; is not valid."><pre class="notranslate"><code class="notranslate">Fatal error: Uncaught UnexpectedValueException: The cookie expiration time "-39600" is not valid.
</code></pre></div>
<p dir="auto">An example of an HTTP header in my response:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Set-Cookie	ADRUM_BTs=R:54|s:p; expires=Wed, 31-Dec-1969 13:00:00 GMT; path=/; HttpOnly"><pre class="notranslate"><code class="notranslate">Set-Cookie	ADRUM_BTs=R:54|s:p; expires=Wed, 31-Dec-1969 13:00:00 GMT; path=/; HttpOnly
</code></pre></div>
<p dir="auto">According to <a href="https://tools.ietf.org/html/rfc6265#section-3.1" rel="nofollow">RFC 6265</a>:</p>
<p dir="auto"><code class="notranslate">Finally, to remove a cookie, the server returns a Set-Cookie header with an expiration date in the past.</code></p>
<p dir="auto">So therefore, having a date in the past is expected behaviour and should result in the cookie being deleted from the cookie jar, I'm assuming.</p>
<p dir="auto"><a href="https://github.com/symfony/symfony/blob/464b67ed09668168cabfd77b6b3cfa26ceb1b0b0/src/Symfony/Component/BrowserKit/Cookie.php#L80">BrowserKit Cookie</a> class throws an UnexpectedValueException if Expires attribute contains invalid value, but <a href="http://tools.ietf.org/html/rfc6265#section-5.2.1" rel="nofollow">RFC 6265</a> states that "If the attribute-value failed to parse as a cookie date, ignore the cookie-av."</p>