session_get_cookie_params()

session_get_cookie_params() — Get the session cookie parameters.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

Signature

session_get_cookie_params(): array

Parameters

This function takes no parameters.

Return value

Returns an array with the current session cookie information, the array contains the following items: "lifetime" - The lifetime of the cookie in seconds. "path" - The path where information is stored. "domain" - The domain of the cookie. "secure" - The cookie should only be sent over secure connections. "partitioned" - The cookie is marked as Partitioned (CHIPS). "httponly" - The cookie can only be accessed through the HTTP protocol. "samesite" - Controls the cross-domain sending of the cookie. "lifetime" - The lifetime of the cookie in seconds. "path" - The path where information is stored. "domain" - The domain of the cookie. "secure" - The cookie should only be sent over secure ...

Example

The PHP manual ships no example for session_get_cookie_params(); the signature and the parameter table above are the contract.

Changelog

VersionChange
8.5.0The "partitioned" entry was added in the returned array.
7.3.0The "samesite" entry was added in the returned array.

See also

session_set_cookie_params()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page session_get_cookie_params() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.