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

Breadcrumb

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

function Cookie::getMaxAge

Gets the max-age attribute.

1 call to Cookie::getMaxAge()
Cookie::__toString in vendor/symfony/http-foundation/Cookie.php
Returns the cookie as a string.

File

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

Class

Cookie
Represents a cookie.

Namespace

Symfony\Component\HttpFoundation

Code

public function getMaxAge() : int {
    $maxAge = $this->expire - time();
    return max(0, $maxAge);
}

API Navigation

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