Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Cookie.php

function Cookie::withExpires

Creates a cookie copy with a new time the cookie expires.

File

vendor/symfony/http-foundation/Cookie.php, line 141

Class

Cookie
Represents a cookie.

Namespace

Symfony\Component\HttpFoundation

Code

public function withExpires(int|string|\DateTimeInterface $expire = 0) : static {
    $cookie = clone $this;
    $cookie->expire = self::expiresTimestamp($expire);
    return $cookie;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal