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

Breadcrumb

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

function SetCookie::setExpires

Set the unix timestamp for which the cookie will expire.

Parameters

int|string|null $timestamp Unix timestamp or any English textual datetime description.:

1 call to SetCookie::setExpires()
SetCookie::__construct in vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php

File

vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php, line 291

Class

SetCookie
Set-Cookie object

Namespace

GuzzleHttp\Cookie

Code

public function setExpires($timestamp) : void {
    if (!is_int($timestamp) && !is_string($timestamp) && null !== $timestamp) {
        trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int, string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
    }
    $this->data['Expires'] = null === $timestamp ? null : (\is_numeric($timestamp) ? (int) $timestamp : \strtotime((string) $timestamp));
}

API Navigation

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