Description

This function sets the location of PHP's default session save path.

Examples




https://hostname.example.com:2087/cpsess##########/json-api/php_set_session_save_path?api.version=1&path=%2Fvar%2Fcpanel%2Fphp%2Fsessions&overwrite=1




https://hostname.example.com:2087/cpsess##########/xml-api/php_set_session_save_path?api.version=1&path=%2Fvar%2Fcpanel%2Fphp%2Fsessions&overwrite=1




whmapi1 php_set_session_save_path path=%2Fvar%2Fcpanel%2Fphp%2Fsessions overwrite=1



{
   "metadata" : {
      "version" : 1,
      "result" : 1,
      "command" : "php_set_session_save_path",
      "reason" : "OK"
   },
   "data" : {}
}




<xml>
  <data></data>
  <metadata>
    <command>php_set_session_save_path</command>
    <reason>OK</reason>
    <result>1</result>
    <version>1</version>
  </metadata>
</xml>



Parameters

ParameterTypeDescriptionPossible ValuesExample
pathstring

The directory in which to save session information.

For security reasons, do not set this value to /tmp or another insecure location.

This parameter defaults to /var/cpanel/php/sessions.

A valid absolute directory path.

/var/cpanel/php/sessions
overwriteBoolean

Whether to overwrite the existing session save path in the php.ini file.

This parameter defaults to 0.

  • 1 — Overwrite the existing value in the php.ini file.
  • 0 — Do not overwrite the existing value in the php.ini file.
0

Returns

This function returns only metadata.