PHP session_set_cookie_params() Function
What is session_set_cookie_params Function?
Explanation
The "session_set_cookie_params()" function is used to set session cookie parameters.
Syntax:
session_set_cookie_params(lifetime[,path][,domain]
[,secure][,http-only]);
In the above syntax, the parameters "lifetime" specifies the lifetime of session cookies in seconds, "path" specifies the path on the domain where the cookie will work "domain" specifies the cookie domain,"secure" should be "true" to sent cookies over secure connections,"http-only" is set to TRUE then PHP will attempt to send the httponly flag when setting the session cookie.
Example :
<?php
session_start();
session_set_cookie_params(3600);
?>
In the above example "lifetime" is set to 60 minutes.