getPath

Learn how to read the cookie path.

This method provides the path of the cookie.

Signature

This method has the following signature:

public function getPath(): string

This method returns the path of the cookie.

Example

Here is a basic example of how to use this method:

<?phpuse Croct\Plug\CookieStorage;
$cookies = CookieStorage::fromGlobals()->getResponseCookies();$path = $cookies[0]->getPath();