Repository: cakephp/cakephp (PHP)

Issue:
Expire cookie when App defaultTimezone is not UTC
### Description

Cakephp 4.x
How to reproduce : 

Configuration
```php
# config/app.php
  'defaultTimezone' => 'Europe/Paris',
```

Tests controller
```php
<?php
declare(strict_types=1);

namespace App\Controller;

use Cake\Http\Cookie\Cookie;

class TestsController extends AppController
{
    public function setCookie()
    {
        $cookie = new Cookie('testing', 'my value');
        $this->setResponse($this->response->withCookie($cookie));

        return $this->redirect('/tests/readCookie');
    }

    public function readCookie()
    {
        if ($this->request->getCookieCollection()->has('testing')) {
            $cookie = $this->request->getCookieCollection()->get('testing');
            debug($cookie);
        } else {
            debug('No cookie. Yeah!');
        }
        exit;
    }

    public function expireCookie()
    {
        $cookie = $this->request->getCookieCollection()->get('testing');
        $this->setResponse($this->response->withExpiredCookie($cookie));

        return $this->redirect('/tests/readCookie');
    }
}
```

Url : `/tests/setCookie` redirect to `/tests/readCookie`. Cookie is displayed
Url : `/tests/expireCookie` redirect to `/tests/readCookie`. Cookie should not be displayed but it is.

Changing the `App.defaultTimezone` fix this.

### CakePHP Version

4.4.11

### PHP Version

_No response_


Discussion: The response when `setcookie()` expires timestamp is negative.

```
HTTP/1.1 302 Found
Host: localhost:8000
Date: Fri, 03 Mar 2023 17:26:25 GMT
Connection: close
X-Powered-By: PHP/8.1.16
Content-Type: text/html; charset=UTF-8
Location: http://localhost:8000/tests/readCookie
X-DEBUGKIT-ID: b94f8d2a-935c-42e0-81c0-d4f7a635f2c0
Set-Cookie: testing=my%20value; path=/
```

The response when `setcookie` expires is set to 1 
```
HTTP/1.1 302 Found
Host: localhost:8000
Date: Fri, 03 Mar 2023 17:27:52 GMT
Connection: close
X-Powered-By: PHP/8.1.16
Content-Type: text/html; charset=UTF-8
Location: http://localhost:8000/tests/readCookie
X-DEBUGKIT-ID: 65a2d9b0-3423-440f-8d73-6a6e0027543e
Set-Cookie: testing=my%20value; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/
```
Maybe this is a php bug

This is a php "bug". sorry

```php
<?php
declare(strict_types=1);

date_default_timezone_set('UTC');

setcookie('old_timestamp', 'my value', 1);
setcookie('negative_timestamp', 'my value', -1);
```
```
HTTP/1.1 200 OK
Host: localhost:8000
Date: Fri, 03 Mar 2023 17:33:45 GMT
Connection: close
X-Powered-By: PHP/7.4.33
Set-Cookie: old_timestamp=my%20value; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0
Set-Cookie: negative_timestamp=my%20value
Content-type: text/html; charset=UTF-8
```



Fix (patch):
diff --git a/src/Http/Cookie/Cookie.php b/src/Http/Cookie/Cookie.php
index f4fea6736cc..24d2494cd5f 100644
--- a/src/Http/Cookie/Cookie.php
+++ b/src/Http/Cookie/Cookie.php
@@ -621,7 +621,7 @@ public function withNeverExpire()
     public function withExpired()
     {
         $new = clone $this;
-        $new->expiresAt = new DateTimeImmutable('1970-01-01 00:00:01');
+        $new->expiresAt = new DateTimeImmutable('@1');
 
         return $new;
     }