PHP session_get_cookie_params() Function

What is session_get_cookie_params Function?


The "session_get_cookie_params()" function is used to get the session cookie parameters.


array session_get_cookie_params(void)

The array can contain following parameters
  • "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.
  • "httponly" - The cookie can only be accessed through the HTTP protocol.

Example :

$array = session_get_cookie_params();
while (list($key,$val) = each($array)) {
echo "$key => $val";
Result :

lifetime => 0 path => / domain => secure => httponly =>

In the above example the we list the array parameters of the session_get_cookie_params() listed by keys and values.

PHP Topics

Ask Questions

Ask Question